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


当前回答

// repopulate, slight hax (or strong assumptions :P) below

其他回答

我记不清了,大概是这样的:

Person p = new Person("John", "Doe", "male");
Collection women = new ArrayList();
women.insert(p.getTail());

这是肮脏的代码;)

//你不需要理解这个

经典。

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

/* 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.

其中最经典的是皮埃尔·德·费马对他著名的“大定理”所作的评论:“这一页的空白处太小了,无法写下证明。”

350多年后才找到证据。

(根据维基百科,这是原文:)

Cubum autem在双cubos, aut 二元象限 象限,和将军 无限超quadratum中的一无所有 在两种情况下 我们是恶魔 米拉比林健康。Hanc marginis exiguitas不是caperet。

...并翻译成英语:

(把立方体分开是不可能的 化成两个立方,或者化成四次方 2 / 4次方,或者一般来说,任意 幂大于二成二 喜欢权力。我发现了一个真正的 这是一个绝妙的证明 边际太窄,无法容纳。)

// Bad Christian, No cookie

这里的Cookie不是指浏览器Cookie