你遇到过的源代码中最好的注释是什么?
当前回答
不记得我在哪里见过这些了
long time; /* know C */
and(在代码中创建某种UNIX守护进程):
/* Be a real daemon: fork myself and kill my parent */
其他回答
在为一家芬兰移动网络设备制造商工作期间,我深入研究了硬件抽象层,发现芬兰语单词“puukko”出现了100多次。
“puukko”是一种万能刀,每个芬兰人的工具箱里或家里都有。它被用于从剥土豆到电脑维修(我的观察)的所有事情。我相信在这个语境中,它相当于芬兰语中的“Hack”。
我的芬兰同事否认了这一点,并说这更像是“外科手术/干预”……我差点就相信了,直到我看到下面的评论:
/* Perkele ISO Puukko! */ -> Fucking Big Hack!
when :orientation
## Avoid matching gay people with straight people - they hate it, they do, they really do.
query_parameter = "(users.orientation = 'Bi' OR (users.orientation = 'Straight' AND users.gender IN ('#{user.opposite_genders.join('\',\'')}')) OR (users.orientation = 'Gay' AND users.gender IN ('#{user.same_genders.join('\',\'')}')))"
从一个约会网站…
// This code was written by a genius so don't try to understand it with
// your tiny little brain.
//The following code is commented out
//(a load of commented out code followed)
/* This is O(scary), but seems quick enough in practice. */
后面是四个嵌套的for循环