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


当前回答

const int TEN=10; // As if the value of 10 will fluctuate... 

其他回答

在PeopleSoft Financials PeopleCode的早期版本中:

/* I don't know how you can ever get here so I'll have to fix it later */
// TODO: Drive an ashen stake through the foul heart of this function.

这是一个糟糕的函数。直到今天我还在做噩梦。

我最喜欢的评论是我的一个同性恋朋友说的。他喜欢用VB标记他所有的TODO注释。净,

'TODO: Matt Damon

有时会提供额外的信息,但通常不是这样。

// this error could never happen

然后,客户打电话说他看到一条错误消息说"这个错误永远不会发生"

//If the Current Record is Getting End Dated, We should not create New History Entry. 
//We Just need to Update the Previous History Entry
//If the History is already End Dated and the New Record is now removing End Date, Then 
//We should not update the Previous History End Date. 
//We Just need to Create the New History Record Only.
//Alright.. 
//Alright.... 
//Enough Comments. Code it. :-)