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


当前回答

// John! If you'll svn remove this once more,
// I'll shut you, for God's sake!
// That piece of code is not “something strange”!
// That is THE AUTH VALIDATION.

你怎么看?下面的代码是安全的“svn删除”。

其他回答

在初始化链表时:

last = first; /* Biblical reference */

简洁而滑稽。

// I love the smell of dirty XML in the morning
xml = xml.Replace("xmlns=\"urn:bsd.orion/inventory\"", "");

一些来自Linux内核的代码:

/* Sun, you just can't beat me, you just can't.  Stop trying,
* give up.  I'm serious, I am going to kick the living shit
* out of you, game over, lights out.
*/

-

/* 2,191 lines of complete and utter shit coming up... */

-

#if 0 /* XXX No fucking way dude... */

这个我在Python 2.5的“twisted”包中找到的(文件是tcp.py在第371行)

# Limit length of buffer to try to send, because some OSes are too
# stupid to do so themselves (ahem windows)
return self.socket.send(buffer(data, 0, self.SEND_LIMIT))

Dennis M Ritchie在这里有一个关于一些古老UNIX注释的页面