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


当前回答

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!!!
}

其他回答

// The ratio of a circle's circumference to its diameter.  Remember to change
// this to 3.0 if you move to a site in Indiana.

#define Pi                                      3.1415927
// This should fix something that should never happen
catch (Ex as Exception)
{
     // oh crap, we should do something.
}

没有什么比一个空的catch块更能让人觉得代码是健壮的....

来自usenet的经典:

Teradyne硬件建模器代码的深层是一个例程 一大堆十六进制数字到SYS$QIO调用中。唯一的评论是 “这里发生了奇怪的魔法”。

// Okay, let's do the loop, yeah come on baby let's do the loop
// and it goes like this ...