分享 老码农冒死揭开行业黑幕:如何编写无法维护的代码

leozwa · December 30, 2014 · Last by suffering replied at January 05, 2015 · 3396 hits

注:别看译文

那明明是“金典”, 做哪些不做哪些很明确了。

拉出去把 DD 切了

Åccented Letters

Use accented characters on variable names. E.g. typedef struct { int i; } ínt; where the second ínt's í is actually i-acute. With only a simple text editor, it's nearly impossible to distinguish the slant of the accent mark.

这个太黑了。。我碰到过类似的一个情况,找了一下午!

达到这种境界的人很多。

测试一下:

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 ]; 
}

还好。

我觉得我要是这么玩儿,坑的第一个人肯定是我自己。

#4 楼 @raven 还真有这种人?!

Unknow user #8 December 31, 2014

😄

#7 楼 @cqcn1991 我自己输入错的字符。。

#7 楼 @cqcn1991 #9 楼 @raven 中文的 +-=和英文的+-=也很难看出来,不过有语法高亮的话就不是问题了,但很容易被忽视

以前中学阶段参加信息学竞赛,那些要求纸读代码写结果的题目,很多都符合这个标准,真是作孽啊。

以一个坏人的角度来写这样一篇文章,读起来很有趣。假如作者教条一般地罗列这么多准则,谁回去读,起码我不会。

不用你们教的,我天生就会 😄

You need to Sign in before reply, if you don't have an account, please Sign up first.