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


当前回答

这是在PHP代码中找到的

$s=2; // chicken and bacon wrap for lunch

多么有用,幸运的是$s是不言自明的

其他回答

public GetRandomNumber()
{
    // Chosen by a fairly rolen dice
    return 12;
}

在头文件的顶部:

/* Project : XYZ (Please somebody shoot me!)
 *
 * File : $Id: defs.h,v 1.1 $
 *
 * Purpose : Create havoc rather than peace among many nations
 *
 * History : Back-ported changes that were not in CVS.  Please somebody,
 *  shoot us and put us all out of our misery.
 */

“XYZ项目”(已改名)是一个长达七年的折磨。最后这句话是由一个从头到尾都参与其中的坚定的灵魂写的。

class Act //That's me!!!
{

}
// Bad Christian, No cookie

这里的Cookie不是指浏览器Cookie