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


当前回答

/* Only break the connection if it actually exists. It is important to
 * check the timeslot saved in the SOURCE of the disconnect message. */

我写了这条评论,现在我不记得为什么它很重要了…

其他回答

//Please comment on your source code
// this is really complicated

没有其他评论了

我曾经参与过Windows 3.0的源代码。(我赶紧补充一句,作为一名微软员工,不是!)在那里,我遇到了一个文件加载器,它可以多次重新输入,并且有一个讨厌的双关语的例子(只是为了显示作者有多聪明)。

这些乱七八糟的可重入代码是用Intel程序集jmp指令(在C代码中间)执行的,它的标签是“we_are_not_in_kansas_any_more_toto”。

不是注释,而是属性

[ThereBeDragons]

还有一个是我在IHttpHandler的实现中看到的

//What is this?
public bool IsReusable
{
    get{return false;}
}

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

// This only exists because Scott doesn't know how to use const correctly