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


当前回答

多年前,我遇到了这样一个问题:

/***************************************************************************/
/*  deep wizardry. do not touch.                                           */
/*                                                                         */
/*  no seriously.  XXXXXX I'm looking at you. If you screw with this again */
/*  I will kill you with my swingline stapler.                             */
/*                                                                         */
/* ...                                                                     */

然后描述了一个特别复杂的算法。

其他回答

这是我们团队微观管理效果的一个活生生的例子:

// I am not responsible of this code.
// They made me write it, against my will.

... 我们敬爱的技术总监很喜欢把代码和编码指南都硬塞到开发人员的喉咙里(*)。

当然,当项目负责人寻找bug的原因时,发现它在“非最佳代码”中,他就不那么高兴了……

(*)当然,我指的是强大的VB国王……如果你想评估强大的VB国王的全部力量,你可以阅读下面的SO帖子:你被迫遵循的最奇怪的编码标准规则是什么?...

// need a coffee to fix this.

在SJ CA拍卖业务的早期,我曾与一个名叫Rick Dorin的人合作过。他写编译器的时候,你必须整天拨弄卡片。他的错误信息之一是

错误太多……让更少的!

// I don't know why I need this, but it stops the people being upside-down

x = -x;
/* My lawyer told me not to reveal */