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


当前回答

当我还在路透社工作的时候,我们的一个feed处理人员发表了一条评论,让一些人认为万能的上帝在帮助我们……

// Jesus told me to skip to the end of the message here

后来我们发现有一个拉丁美洲的联系人叫耶稣(HeyZus)。

其他回答

//If you're reading this, then my program is probably a success
// I have to find a better job

Many years ago (about 1994) I was working on a Oracle PRO*C application for a large multi-national software company that you will have heard of. The app I was working on was a massive Oracle application and they had a utility that ran overnight tidying up data and doing all sorts of aggregate calculations. Every time anything needed doing as a batch job, it got shoved into this utility and as you can imagine it became an absolute monstrosity. It was also notable for the tiny number of comments that it had for such a massive program.

它为数不多的评论之一仍然是我所见过的对纯粹的WTF的最好的评论……我试图在一个函数中找到一个bug,它有数百行长,中间是函数中唯一的注释:

/* I did this the other way */

直到今天,这仍然是我所见过的最好的评论。

THIS PROGRAM HAS CODE THAT DOES NOT MEET STANDARDS      

这个评论几乎出现在我们这里的每一个节目中....

下面是一个必须声明的局部变量,只是为了将一个常量传递给库函数:

// This only exists because Scott doesn't know how to use const correctly