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


当前回答

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

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

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

其他回答

我在查看TVNZ网站早期迭代的HTML源代码时发现了这个宝藏(如果你在家玩的话,从571行开始):

<!-- Hopfully we can do this otherwise the nav is going to be pretty plain and Hong will go postal. -->
Case 1:
   ...
   break;
   ...
//I don't want do do this but [my coworker] says it's part of the code standard
default:
   break;
/* You are not meant to understand this */ 
// this is really complicated

没有其他评论了

//把这个放在这里的人是个白痴…这根本不管用!

但是代码还在那里……