程序员 seo 2b青年
外国程序员的那些雷人注释
来点娱乐的,虽然是很久前的了,看一下外国程序员如何苦中作乐,展现出程序员们闷骚的一面。
//dear maintainer:
//
//once you are done trying to 'optimize' this routine,
//and have realized what a terrible mistake that was,
//please increment the following counter as a warning
//to the next guy:
//
//total_hours_wasted_here = 16
亲爱的代码维护人员:
当您尝试优化这段代码但发现这是一个极端错误的决定的时候,
请修改下面的计时器,以便警示后人。
总计浪费在这段代码的时间=16小时
//I dedicate all this code,all my work, to my wife,darlene, who will
//have to support me and our three children and the dog once it gets
//released into the public.
谨以此代码献给我的妻子达林,感谢她一直支持我,还有我三个孩子和一只狗
/*
*You may think you know what the following code does.
*But you dont. Trust me.
*Fiddle with it ,and youll spend many a sleepless
*night cursing the moment you thought youd be clever
*enough to "optimize" the code below.
*Now close this file and go play with something else.
*/
你可能会认为你读的懂以下代码。但你不会懂的,相信我吧。
要是你尝试玩弄这段代码的话,你将在无尽的通宵中不断咒骂自己为什么会认为自己聪明到可以优化这段代码。
好了,现在请关闭这个文件去玩点别的吧。
// I am not sure why this works but it fixes the problem.
反正这个办法就修复了问题,我也不知道为什么会这样
# To understand recursion,see the bottom of this file
At the bottom of the file;
# To understand recursion, see the top of this file
要理解什么是递归的话,请参考本文件的底部
(在文件的底部)
要理解什么是递归的话,请参考本文件的顶部
//Dear future me.Please forgive me.
//I can't even begin to express how sorry I am.
亲爱的未来的我自己,请原谅我。
我有着难以表达的歉意。
//I am not responsible of this code.
//They made me write it ,against my will.
我不对以下代码负责。
是他们逼我写的,是违背我意愿的。
// if iever see this again i'm going to start bringing guns to work
要是再让我看到这种代码,我会带着枪来上班的
/*
* OK;before you read the following code know what I am trying to do.
* I needed to get the list of child catagories from the root node so that
* the root node didn't appear in the selection box. But for some stupid
* fucking reason the stupid fucking DBA wont let me access the items using
* indicies and I instead have to use their stupid fucking Iterator
* implementation.So there.
*/
$firstlist = $this->getRootNode()->getChildren();
foreach($firstlist as $node)
{
$nodes = $ node->getChildren();
break; //wtf?
}
在你阅读以下代码时,你要先搞懂为什么我在这样做。
我想读取一个跟节点下面所有的子节点,以便控制根节点不会显示在选择框上。但那个傻逼的DBA找了一些某些傻逼的借口不让我用索引去读取这些数据,而要求我用他们傻逼的迭代器。所以有了以下代码。
//When I wrote this ,only God and I understood what I was doing
//Now,God only knows
当我写这段代码的时候,只有老天合我知道我在做什么。
现在,只剩老天知道了