程序员经典语录

2015-04-11
翻译

We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil.

我们应忽略掉无关紧要的效率提升,在 97% 的情况下:过早优化是万恶之源。


Walking on water and developing software from a specification are easy if both are frozen.

在水面上行走和在需求上进行开发的共同点是,如果下面的东西不动的话就会容易得多。


Hofstadter’s Law: It always takes longer than you expect, even when you take into account Hofstadter’s Law.

霍夫斯塔特定律:事情花费的时间总是多于你的预期,即使你已经考虑霍夫斯塔特定律。


Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems.


Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

调试代码的难度是写代码的两倍。因此,如果你没有足够的聪明才智去调试的话,就不要把代码写得太有技巧。


Measuring programming progress by lines of code is like measuring aircraft building progress by weight.

用代码量来衡量工程进度就像是用重量来衡量飞机制造的进度。


PHP is a minor evil perpetrated and created by incompetent amateurs, whereas Perl is a great and insidious evil, perpetrated by skilled but perverted professionals.

PHP是无能的业余爱好者创造出来的低级恶魔,而 Perl 是技艺娴熟的专家精心炮制的,潜伏着的超级恶魔。


On two occasions I have been asked, ‘Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?’ I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question.”

我两次被问起这个问题:“先生,如果我输入错误的数据,是否能得到正确的结果呢?”我始终想不通怎样混乱的思想才会提出这样的问题。


Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

写代码的时候永远要想像着来维护你的代码的人是个有暴力倾向的疯子,并且他知道你的住址。


Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

现代编程,就像是“软件工程师奋力建造更大更好的傻瓜验证程序”和“世界奋力建造更大更好的傻瓜”之间的一场竞赛。目前为止,后者处于领先地位。


I don’t care if it works on your machine! We are not shipping your machine!

我一点儿也不在乎在你的电脑上是不是运行成功了!我们又不是要发布你的电脑!


I have always wished for my computer to be as easy to use as my telephone; my wish has come true because I can no longer figure out how to use my telephone.

我一直梦想着我的电脑能像我的电话一样使用方便;现在我的梦想实现了,因为我不知道怎么用我的电话了。


A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila.

电脑在“让你更多更快地犯错误”这一点上超过了人类历史上所有其它发明,可能手枪加龙舌兰洒是个例外。


If debugging is the process of removing software bugs, then programming must be the process of putting them in.

如果把调试定义为铲除软件 BUG 的过程,那么编程就可以被定义为引入 BUG 的过程。


It is practically impossible to teach good programming style to students that have had prior exposure to BASIC. As potential programmers, they are mentally mutilated beyond hope of regeneration.

有过 BASIC 开发经验的学生几乎不可能学会好的编程风格。作为潜在的程序员,他们大脑所受的伤害完全超出了重建的可能性。


Perl – The only language that looks the same before and after RSA encryption.

Perl – 仅有的一种用 RSA 加密前和加密后看起来差不多的编程语言。


I love deadlines. I like the whooshing sound they make as they fly by.

我爱“最后期限”。我喜欢它们像飞驰而过一样发出的“嗖嗖”声。


Saying that Java is good because it works on all platforms is like saying anal sex is good because it works on all genders

说 Java 好只因为它能适应所有平台,就好比说肛交好只因为它能适应所有性别。


XML is like violence – if it doesn’t solve your problems, you are not using enough of it.

XML 就像暴力 — 如果它解决不了你的问题,就是因为你使用得不够。


Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer.

爱因斯坦说,一定有简单的规则来解释自然,因为上帝不会是变幻莫测或者独断专行的。软件工程师不会有这个信仰。


And then it occurred to me that a computer is a stupid machine with the ability to do incredibly smart things, while computer programmers are smart people with the ability to do incredibly stupid things. They are, in short, a perfect match.

电脑是一台愚蠢的机器,却有能力做出不可思议聪明的事情;程序员是聪明的人,却有能力做出不可思议愚蠢的事情。哈,他们真是绝配。


Version 1 of any software is full of bugs. Version 2 fixes all the bugs and is great. Version 3 adds all the things users ask for, but hides all the great stuff in Version 2.

所有软件的第 1 个版本都满是 bug;第 2 个版本修复了所有的 bug,很好很强大;第 3 个版本加入了用户要求的所有特性,却不见第 2 个版本的所有优点。


If Java had true garbage collection, most programs would delete themselves upon execution.

如果 Java 有真正的垃圾清理,大多数的程序在运行的时候都会把自己清理掉。


You should name a variable using the same care with which you name a first-born child.

给变量命名应该像给自己的第一个孩子命名一样慎重。


Optimism is an occupational hazard of programming: feedback is the treatment.

乐观是编程的职业病,反馈信息是其解药。

comments powered by Disqus

全面使用 UTF-8

2015-04-19
翻译

GNU make 自动依赖生成

2015-04-11
翻译 教程

程序员笑话集锦

2014-11-01
翻译