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


当前回答

BerkeleyDB

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

其他回答

// The following strings are meant to be funny.  Do not edit these strings
// unless you are funny, too.  If you don't know if you're funny, you're
// not funny.  If fewer than 2 people unrelated to you have told you that 
// you're funny, you're not funny.

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

// TODO: Need some codemonkey to doc comment this class.
/* My lawyer told me not to reveal */
//Woulda
if(x) {}
//Shoulda
else if(y) {}
//Coulda
else {}
// I dedicate all this code, all my work, to my wife, Darlene, who will 
// have to support me and our three children and the dog once it gets 
// released into the public.