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


当前回答

//ha, you thought I was lazy didnt ya?!

其他回答

在一些非常蹩脚的vb代码(我知道这都是蹩脚的,但),我发现这是一个空的if控制块中的注释,它说:

If bFound Then
     'I love it when I write kick ass code like this
Else
  .
  .

首先,在一个大对象的更新的开始:

/*General note to all who tread in the <ObjectName>() code...
 * The SetOriginals() method from the BaseEntity class should be called (and only called) right after the Get() method
 * call as seen above.  Calling the SetOriginals method elsewhere will result in bugs and all kinds of other nasty suprises.
 */

然后在大约200行逻辑之后更新对象:

//Attempt to explain this confusing mess of code:
//First time you save an actual absence this is what happens:
//0. The first save saves to the <TableName> table (among other things). (Fig. A)
//1. The <CalculationMethod> method is called next which inserts to the <OtherTableName> table. 
//(This is the table that keeps track of credits to the case.) (Fig. B)
//2. So then you have to call <UpdateCalculations> to move the <TableName> records to the <ThirdTableName> table. (Fig. C)
//3. Then you go back and run calculations since you have the debits table (<ThirdTableName>) populated. (Fig D.)
//4. Then a final save to save the calculations back to the case. (Fig. E)
//Yeah, I know what you're thinking:  this sucks. 10/01/07 XXX

开发商是对的……这太糟糕了!

我没有这个来源的副本,但我一直记得它:

//如果你想不明白,就不要读这篇文章

我曾经在一个项目中发现了这样的评论:

// Cabbage fart?

我不知道那是什么意思。还好我的魔方不在写它的人旁边。

//FIXME: fix this before the 1.0 release

他们在第4版