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


当前回答

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

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

其他回答

我最喜欢的是这样的

 # commented out
 ...
 ### end of the formerly uncommented #2001-02-22 John Doe
try {

}
catch (SQLException ex) {
    // Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
    //If you thought you were screwed before, boy have I news for you!!!
}
/* Here I sit, Joe broken hearted, came to do some sh*t, but only just started. */

关于一些繁重的正则表达式输入验证。

// insert comment here
// If I from the future read this I'll back in time and kill myself.