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


当前回答

这是在PHP代码中找到的

$s=2; // chicken and bacon wrap for lunch

多么有用,幸运的是$s是不言自明的

其他回答

在LKM中:

/*
* Dear Richard Stallman,
*
* This one's for you.
*
* Sincerely,
* Me
*
*/
MODULE_LICENSE( "GPL" );

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

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

我刚刚在一些遗留代码中发现了这个..

'CANNOT JUST QUIT!
//Do not continue reading if you dont want to die.

这个差点要了我的命。

// (c) 2000 Applied Magic, Inc.
// Unauthorized use punishable by torture, mutilation, and vivisection.

啊,我一直很喜欢这个……