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


当前回答

大学时代:

//why the f*** we have to move this here to make it work

当我们和教授一起复习的时候,它在印刷资料中被突出了。

原因是:一些与缓冲区溢出相关的严重错误,影响了代码中其他位置的文件处理程序中不相关的变量。移动变量将使它再次工作。

其他回答

来自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。

所有bug由David S. Miller添加

注意上面代码中的bug;我只是证明了它是正确的,并没有尝试过。

这是唐纳德·克努斯写的。

/**
 * If you don't understand this code, you should be flipping burgers instead.
 */

消毒:

//Forward declarations:

class X {}; // TODO: Remove {}  ! When we get X defined....