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


当前回答

在一个著名的商业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. */

其他回答

我经常发现这个

// fix it!

不是注释,而是属性

[ThereBeDragons]

还有一个是我在IHttpHandler的实现中看到的

//What is this?
public bool IsReusable
{
    get{return false;}
}
/* Please work */
//Woulda
if(x) {}
//Shoulda
else if(y) {}
//Coulda
else {}

我发现了这个:

I'm not sure what I did