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


当前回答

在被迫为贫血域对象编写单元测试时,这些对象不过是getter和setter的包(我也是被迫写的):

// zzzzZZZZzzzz....

其他回答

这是我们在大学宿舍使用的自定义DHCP服务器,根据它们是否注册/安装补丁和防病毒,将计算机放入“干净”或“脏”IP地址池:

public boolean getDirty (String MAC) // not as fun as it sounds
//ALL YOUR BASE ARE BELONG TO US

...这让我的老板以为有人黑进了系统。他不知道这个笑话。

这是在PHP代码中找到的

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

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

// (c) 2000 Applied Magic, Inc.
// Unauthorized use punishable by torture, mutilation, and vivisection.

啊,我一直很喜欢这个……

一些来自Linux内核的代码:

/* Sun, you just can't beat me, you just can't.  Stop trying,
* give up.  I'm serious, I am going to kick the living shit
* out of you, game over, lights out.
*/

-

/* 2,191 lines of complete and utter shit coming up... */

-

#if 0 /* XXX No fucking way dude... */