你遇到过的源代码中最好的注释是什么?


当前回答

// I don't know why I need this, but it stops the people being upside-down

x = -x;

其他回答

Case 1:
   ...
   break;
   ...
//I don't want do do this but [my coworker] says it's part of the code standard
default:
   break;

所有bug由David S. Miller添加

下面是一个必须声明的局部变量,只是为了将一个常量传递给库函数:

// This only exists because Scott doesn't know how to use const correctly
public boolean isDirty() {
    //Why do you always go out and
    return dirty;
}

我最喜欢的评论是我的一个同性恋朋友说的。他喜欢用VB标记他所有的TODO注释。净,

'TODO: Matt Damon

有时会提供额外的信息,但通常不是这样。