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


当前回答

// Singleton object. Leave $me alone.
private static $me;

其他回答

#定义TRUE FALSE //快乐的调试傻瓜

这是我自己代码中的一个,但它仍然非常有趣,我认为最好还是把它放在网上,因为它是在公共SVN中。

// These were orginally up and down. When it was clear the names were
// inapplicable, they were renamed to retain the joke.
// Sorry if you were hoping for useful variable names.
quantum strange, charm;

不是注释,而是属性

[ThereBeDragons]

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

//What is this?
public bool IsReusable
{
    get{return false;}
}

我告诉学员至少做一些异常处理。这是我在每一个db调用....返回

Catch (Exception e) {
    //eat it
}
try {
  dataSource.close();
}
catch (SQLException ex) {
  // Do nothing, since we're going to trash this anyway
}

当然,这类事情实际上是JDBC(或者至少是Oracle的JDBC驱动程序)中的wtf,因为它可以在关闭连接时抛出SQLExceptions…