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


当前回答

来自usenet的经典:

Teradyne硬件建模器代码的深层是一个例程 一大堆十六进制数字到SYS$QIO调用中。唯一的评论是 “这里发生了奇怪的魔法”。

其他回答

// this is really complicated

没有其他评论了

我在我发布的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.
*/
  rescue
    # silently, we fail
    # many validations fade
    # like tear drops in rain
  end

这只是众多案例中的一个……

早在80年代早期,我在汇编器中看到了这个(引用于模糊的记忆):

I don't understand how the following bit works, but it worked in the program I stole it from.

在一个巨大的800行'switch'语句中,在中间的某处:

// Joe is sorry

几百行之后……

// Harry is sorry too