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


当前回答

/*
 * You may think you know what the following code does.
 * But you dont. Trust me.
 * Fiddle with it, and youll spend many a sleepless
 * night cursing the moment you thought youd be clever
 * enough to "optimize" the code below.
 * Now close this file and go play with something else.
 */ 

其他回答

// Added because boss changed his mind : 20020111,20020501,20020820, ...
// Commented out because boss changed his mind : 20020201,20020614,20020908, ...

在ETL脚本之间的主要黑客RPG数据库和SQL Server一个。我大概有10到20次这样的评论……

/**
 * Not even your mum thinks you're special if you call this method
 */    
onlyYourMumThinksYoureSpecialIfYouCallThisMethod() {...}
v.bpc     := v.pc;  -- Remember to jump back
v.baccu   := accu;  -- Yo dawg, heard you like runing instructions
                    -- so I took backup of your accu so you can run
                    -- instructions while you run instructions.
v.flags.i := false; -- No more interupts

大约10年前,我从事图像处理工作,通过扫描显微镜视频帧来检测细胞运动。我当时在做一个特别复杂的工作,决定和朋友出去喝一杯。当我回到家时,我工作了一会儿,但没有太多,因为我喝醉了。第二天早上,我发现了一个10行完全混乱的函数,带有以下注释(显然是我自己写的):

/* Ah ah ah! You'll never understand why this one works. */

最奇怪的是,它竟然起作用了。

// If I from the future read this I'll back in time and kill myself.