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


当前回答

//你不需要理解这个

经典。

其他回答

在我们的应用程序中第一次重新编译FreeTextBox3,因为我们需要IE8支持…看看我发现了什么

// IE7 update. this is still bad code, but IE8 is probably a long way off :)

大概30页的xslt的中间部分

<!-- Here be dragons  -->

事实上,有一天我在一些代码上看到了这个,这些代码是在截止日期很急的时候写的。

//This was clearly written under duress

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 */

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

// If this comment is removed the program will blow up