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


当前回答

// Sorry dirty code

其他回答

我想我有过这样的经历:


if (case1) { // trivial
...
}
else { // we are screwed
 /* fill in later */
}

好吧,我可能用了一个比搞砸更强烈的词

我只是发表了这样的评论:

// this control (Resistance) is FUTILE! 

摘自UNIX版本6源代码,大约1975年:

/* You are not expected to understand this. */

这是一个旧的IOCCC获奖条目,我不得不下载整个获奖档案——一个巨大的1.4 M——和grep的几个短语,我记得错了才找到它。

从语法上看,这可能不是注释。或许是这样。我还没想明白。它肯定没有注释分隔符,但也没有字符串分隔符。

C="Lint says "argument Manual isn't used."  What's that
mean?";

没有价格来猜测棉绒的产量。

对于好奇的人来说,这个条目在这里。

/**
 * Always returns true.
 */
public boolean isAvailable() {
    return false;
}

永远不要依赖评论……