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


当前回答

我在我发布的WordPress模板中发布了这个“许可声明”。不管怎样,我觉得这很有趣。

/* The License:
You (from this point on referred to as The You) are hereby 
granted by me (from this point on referred to as The Me) 
license to knock yourself silly with this template. 
By using this template The You implicitly accepts this 
license and pledges solemnly to never claim creative 
ownership of any graphics, code, concepts, eggs, bacon, ideas, 
colors, shapes, hypertext-transfer protocols or other conduits 
of the visual splendor thatis this template. 

The Me, in turn, pledges equally solemnly to be far too 
lazy to ever check up on you, so if you do manage to pull 
some chicks The Me won't have a cow. 
However The Me would be sorely disappointed if The You 
were to try and sell or distribute this work without 
acknowledging The Me. Seriously. The Me will come down on 
The You like a large quantitiy of hard and heavy objects 
that in large quantities may be harmful and possibly even 
lethal to The You; So don't even think about it, The Buster.
*/

其他回答

来自sendmail配置文件。一页又一页看起来就像线条噪音。我发现了这块宝石。

# insert this handy debugging line wherever you have problems
#R$*                $:$>99$1
if(m_measures =/*=*/ --index)
{
    ....
// I have to find a better job

经典ASP:

'Is it worth it, let me work it'
'I put my thing down, flip it and reverse it'
'Ti esrever dna ti pilf, nwod gniht ym tup I'

NextIP = StrReverse(UserRecordset.Fields.Item(0))

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

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

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

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

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