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


当前回答

这似乎阻止了白痴搞砸我的代码…

// Autogenerated, do not edit. All changes will be undone.

其他回答

else
{
    //error situation
}
// TODO - Comment this function

来自Apache Xalan源代码:

/**
 * As Gregor Samsa awoke one morning from uneasy dreams he found himself
 * transformed in his bed into a gigantic insect. He was lying on his hard,
 * as it were armour plated, back, and if he lifted his head a little he
 * could see his big, brown belly divided into stiff, arched segments, on
 * top of which the bed quilt could hardly keep in position and was about
 * to slide off completely. His numerous legs, which were pitifully thin
 * compared to the rest of his bulk, waved helplessly before his eyes.
 * "What has happened to me?", he thought. It was no dream....
 */
protected static String DEFAULT_TRANSLET_NAME = "GregorSamsa";

进一步阅读The Daily WTF。

当我在一些网站上工作时,我在嵌入式JS的开始发现了这一点:

我觉得这么做很肮脏,但那家伙想在。net中实现它

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

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