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


当前回答

catch (Domain.ConcurrencyException)
{
    // somebody changed it between the time we loaded it and now.
    // weird, huh?
}

其他回答

//把这个放在这里的人是个白痴…这根本不管用!

但是代码还在那里……

在一个艺术资产导出工具中,我偶然发现了一个从数字(阿拉伯)到罗马数字的完整转换器。它是这样的:

/*
//You can tell I was bored
//I wanted to do this for a long time
char* ConvertToRoman(int number, int base)
{
... whole code here
}
*/

编写这段代码的人的团队已经处理了很长时间,我猜这影响了他们的理智。

我最喜欢的是已故的Paul DiLascia:

//作者:如果这段代码工作,它是由Paul DiLascia写的。如果不是,我就不知道是谁写的了。

// A Gorgon class - For the love of Zeus don't look directly at it!
try {

}
catch (SQLException ex) {
    // Basically, without saying too much, you're screwed. Royally and totally.
}
catch(Exception ex)
{
    //If you thought you were screwed before, boy have I news for you!!!
}