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


当前回答

我刚刚完成了一个日志框架(使用Trace,为什么没有这样的存在我不知道)。我做了一个继承自TraceListener的方便基类。它覆盖了所有的TraceListener方法,并将它们路由到一个方法中——因此有很多文档注释:

// TODO: Need some codemonkey to doc comment this class.

其他回答

public function get state( /* of Palestine back */ ):Boolean
-- Change Log:  Not needed. The code is perfect 'cause I wrote it.
-- If you change it, it will break.

我正在检查一些代码注释,以检查它们是否有意义,并看到上面的一行。

-- Comment this later

这是一个4000多行的PL/SQL过程的第2行。唯一的评论。手术已经进行了4年了,后来还是没来…

(A bunch of code that's really weird looking)  //Kludge.
// drunk, fix later

真希望我是在开玩笑。根据编写代码的开发人员的了解,我认为他是认真的。