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


当前回答

// if i ever see this again i'm going to start bringing guns to work

其他回答

试着在谷歌代码搜索中输入你最喜欢的脏话,它会消磨掉许多无聊的时间。以下是我最喜欢的例子:

/* These magic numbers are fucking stupid. */

/* Dear free software world, do you NOW see we are fucking
   things up?! This is insane! */

/* We will NOT put a fucking timestamp in the header here. Every
   time you put it back, I will come in and take it out again. */

# However, this only works if there are MULTIPLE checkboxes!
# The fucking JS DOM *changes* based on one or multiple boxes!?!?!
# Damn damn damn I hate the JavaScript DOM so damn much!!!!!!

/* TODO: this is obviously not right ... this whole fucking module
   sucks anyway */

/* FIXME: please god, when will the hurting stop? Thus function is so
   fucking broken it's not even funny. */

我个人最喜欢的

 # code below replaces code above - any problems?
 # yeah, it doesn't fucking work.
try
{
...
}
catch(Exception ex)
{
//if this happens the world is going to end...
}

现在猜猜发生了什么……

//too much log will kill you

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

不是在代码中,而是在相关的bug跟踪系统中:

这不可能是我代码中的bug。我非常小心地编码。

// The hackiest hack that ever did hack

它在WordPress博客引擎(wp-admin/includes/user.php -如果有人真的想看黑客攻击本身)。