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


当前回答

我曾经在一个用Paradox 3.5 -编写的大型预算系统工作多年后接到一个客户的电话

“我们在调试中遇到了一些注释”-

// This shouldn't happen, if it does, then the bits that automagically 
// worked when I wrote it have stopped working

... !

其他回答

在几年前编写Perl时,我在顶部和底部添加了这些注释:

# <magic type="voodoo">

...

# </magic>

下一个研究它的人在Perl中并不是那么热门,他花了一段时间搜索文档,看看“魔法”和“巫毒”是怎么做的。从那以后,我试着添加更多有用的评论……

// For the sins I am about to commit, may James Gosling forgive me
// John! If you'll svn remove this once more,
// I'll shut you, for God's sake!
// That piece of code is not “something strange”!
// That is THE AUTH VALIDATION.

你怎么看?下面的代码是安全的“svn删除”。

// The following array may contain either TexturedObjects or ColoredObjects.
// I know, it sucks.

从泄露的Win2K源代码:

//这次黑客入侵的规模堪比国家债务的规模。