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


当前回答

在一个艺术资产导出工具中,我偶然发现了一个从数字(阿拉伯)到罗马数字的完整转换器。它是这样的:

/*
//You can tell I was bored
//I wanted to do this for a long time
char* ConvertToRoman(int number, int base)
{
... whole code here
}
*/

编写这段代码的人的团队已经处理了很长时间,我猜这影响了他们的理智。

其他回答

/**
 * Hexadecimal digit
 */
protected $version = -1;
class Act //That's me!!!
{

}

在linux 1.0内核调度器(schedule .c)中:

Dijkstra可能讨厌我。

/*
 *  'schedule()' is the scheduler function. It's a very simple and nice
 * scheduler: it's not perfect, but certainly works for most things.
 * The one thing you might take a look at is the signal-handler code here.
 *
 *   NOTE!!  Task 0 is the 'idle' task, which gets called when no other
 * tasks can run. It can not be killed, and it cannot sleep. The 'state'
 * information in task[0] is never used.
 *
 * The "confuse_gcc" goto is used only to get better assembly code..
 * Dijkstra probably hates me.
 */
asmlinkage void schedule(void)

(…)

来自一个显然在看巨蟒剧团的小伙子:

> //现在,for something完全 > // different: 类theLarch {

//If you're reading this, then my program is probably a success