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


当前回答

   // Some wanker in ISO got rid of ifstream(int), ofstream(int), and
   // fstream(int).  Twit.

其他回答

// TODO: not this

上面写了一个同事迫切需要优化的查询。替他说句话,当时我们几个月都是每周工作70个小时……

我刚刚注意到自己在写这个

// not brilliant solution, but fair enough heh.
using namespace std;            // So sue me

在一个著名的商业DOS电子表格应用程序中:

/* This comment was just added in order to check-in a file that was last 
checked in by [Insert Programmer FirstName] "Back-to-the-Future" [Insert 
Programmer LastName]. While testing for year 2000 problems, he accidentally 
checked-in this file while his machine clock was set forward to the year 2000. 
This meant that the source code was always newer than the object file and 
compiled every time the code was built. I'm checking this file in again to 
fix that. */

注意上面代码中的bug;我只是证明了它是正确的,并没有尝试过。

这是唐纳德·克努斯写的。