ch3.ng

如何写出让同事无法维护的代码?


如何写出让同事无法维护的代码?

01. 程序命名

02. 伪装欺诈

for(j=0; j<array_len; j+ =8){  
  total += array[j+0 ]; 
  total += array[j+1 ];   
  total += array[j+2 ]; /* Main body of    
  total += array[j+3]; * loop is unrolled   
  total += array[j+4]; * for greater speed. 
  total += array[j+5]; */   
  total += array[j+6 ];   
  total += array[j+7 ];
}

03. 文档和注释

04 程序设计

05 测试

06. 其他