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


当前回答

// this error could never happen

然后,客户打电话说他看到一条错误消息说"这个错误永远不会发生"

其他回答

我只是在一个非常简单的大学课程测试c++程序中碰到了这个。

我在评论一个类。

在析构函数中…

// Choose! Choose the form of the Destructor!
// The choice is made! The Traveler has come!
public static final void attachListener(Object listener) {

/* ======================= */

// This does nothing, continue searching

/* ======================= */

...

与听众一起痛苦!

Linux的评论

这里有很多不错的……

这些都是linux中的注释

http://lwn.net/1998/1015/a/f-word.html

我的最爱:

./arch/sparc/kernel/ptrace.c
/* Fuck me gently with a chainsaw... */

./drivers/scsi/qlogicpti.h
/* Am I fucking pedantic or what? */
REM Don't delete this print statement ****** will die

所讨论的流程是一些遗留代码中的服务

下面是一个必须声明的局部变量,只是为了将一个常量传递给库函数:

// This only exists because Scott doesn't know how to use const correctly