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


当前回答

private int mousycounter = 0; //Not really a counter

其他回答

// nobody read comments!
 /**
   * Returns cookies according to the filters specified.
   * 
   * @return array  Cookies!  Nom nom nom nom nom.
   */
 public function data_getCookies($uid, $name) {

在facebook api的某个地方。

在调试别人的JavaScript时,我看到了下面的评论:

// Notice: I feel so dirty doing this, but it's the only way to make it cross browser.

但在阅读Scott Hanselmen的一篇文章时,我看到了下面的引用,它与我在代码中发现的注释非常吻合:

Every line of code you write that you feel gross about will ultimately come back to haunt you. Therefore, avoid writing code that makes you feel dirty.

这很有趣。

/* FIXME This must absolutely be removed before 4.0.7 release
 * TODO really remove this */

我们已经发布了4.0.7,4.0.8,4.0.9和4.1版本…

/* Jeez, this is an ugly mess */

...comment from the X11R6 internals source code circa 1991.