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


当前回答

这是我今天重构一些代码时发现的一条评论

if( year < 100 ): year += 2000 #lol, Y2K

其他回答

//too much log will kill you

这个评论是我自己写的,当降低一些日志的优先级时,否则会写数百MB的垃圾,严重削弱应用程序的性能。

/* Here I sit, Joe broken hearted, came to do some sh*t, but only just started. */

关于一些繁重的正则表达式输入验证。

/*
* Wirzenius wrote this portably, Torvalds fucked it up :-)
*/

摘自UNIX版本6源代码,大约1975年:

/* You are not expected to understand this. */

我曾经在一个项目中发现了这样的评论:

// Cabbage fart?

我不知道那是什么意思。还好我的魔方不在写它的人旁边。