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


当前回答

Get This hack!

在一行汇编代码中,在几页未注释的代码之后。

其他回答

在调试别人的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.

这很有趣。

//Please comment on your source code

不是在代码中,而是在相关的bug跟踪系统中:

这不可能是我代码中的bug。我非常小心地编码。

// If I from the future read this I'll back in time and kill myself. 

BerkeleyDB

/*
 * Chaos reigns within.
 * Reflect, repent, and reboot.
 * Order shall return.
 */
return (DB_RUNRECOVERY);