經典程式設計引言

coolshell發表於2012-04-24

過早的優化是萬惡之源。Premature optimization is the root of all evil!
- Donald Knuth

在水裡行走和以一個需求規格進行軟體開發,有一點是相同的,那就是如果水或需求都被凍住不了,那麼行走和軟體開發都會變得容易。Walking on water and developing software from a specification are easy if both are frozen
- Edward V Berard

Hofstadter 定理:“一件事情總是會花費比你預期更多的時間,就算是你已經考慮過本條Hofstadter 定理”。It always takes longer than you expect, even when you take into account Hofstadter’s Law.
- Hofstadter’s Law

有些遇到問題的人總是會說“我知道,我會使用正規表示式”,那麼,你現在有兩個問題了。(意思是:你本想用正規表示式來解決你已有問題,但實際上你又引入了“正規表示式”的一個新問題)Some people, when confronted with a problem, think “I know, I’ll use regular expressions.” Now they have two problems
- Jamie Zawinski

除錯程式的難度是寫程式碼的兩倍。因此,只要你的程式碼寫的儘可能的清楚,那麼你在除錯程式碼時就不需要那麼地有技巧。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.
- Brian Kernighan

用程式碼行來衡量開發進度,無異於用重量來衡量制造飛機的進度。Measuring programming progress by lines of code is like measuring aircraft building progress by weight.
- Bill Gates

PHP被一些不合格的業餘人員造就成了一個小惡魔;而Perl則是被一些熟練的但不正當的專業人員造就成了一個超級大惡魔。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.
- Jon Ribbens

在兩個場合我被問到:“請你告訴我,如果你給機器輸入了錯誤的數字,那麼,是否還能得到正確的答案?”我並不能正確領會這類想法。(注意,本引言的作者姓Babbage,這個名字和神父同名,意思是,作者在反問提問的人,你是問我還是向神父祈禱?)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.”
- Charles Babbage

在程式設計的時候,我們一定要想像一下,以後維護我們自己的程式碼的那個人會成為一個有暴力傾向的瘋子,並且,他還知道我們住在哪裡?Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
- Rick Osborne

現代的程式設計是“程式設計師努力建一個更大更傻的程式”和“世界正在嘗試創造更多更傻的人”之間的一種競賽,目前為止,後者是贏家。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.
- Rich Cook

我才不關於我的程式碼是否能在你的機器上工作!我們不會給你提供機器。I don’t care if it works on your machine! We are not shipping your machine!
- Ovidiu Platon

我總是希望我的電腦能夠像電話一樣容易使用;我的這個希望正在變成現實,因為我現在已經不知道怎麼去使用我的電話了。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.
- Bjarne Stroustrup

計算機是一種在人類歷史上所有發明中,可以讓你比以前更快地犯更多的錯誤的發明,同樣,其也包括了“手槍”和“龍舌蘭酒”這兩種發明的缺陷。A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila.
- Mitch Ratcliffe

如果除錯程式是一種標準的可以剷除BUG的流程,那麼,程式設計就是把他們放進來的流程。If debugging is the process of removing software bugs, then programming must be the process of putting them in.
- E. W. Dijkstra

教一群被BASIC先入為主的學生,什麼是好的程式設計風格簡直是一件不可能的事。對於一些有潛力的程式設計師,他們所受到的智力上的傷害遠遠超過了重建他們的信心。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.
- E. W. Dijkstra

理論上來說,理論和實際是一樣的。但實際上來說,他們則不是。In theory, theory and practice are the same. In practice, they’re not.
- Unknown

只有兩個事情是無窮盡的:宇宙和人類的愚蠢。當然,我現在還不能確定宇宙是無窮盡的。Two things are infinite: the universe and human stupidity; and I’m not sure about the universe.
- Albert Einstein

Perl這種語言就好像是被RSA加密演算法加密過的一樣。Perl – The only language that looks the same before and after RSA encryption.
- Keith Bostic

我愛“最終期限”,我喜歡“嗖嗖嗖”的聲音就像他們在飛一樣。I love deadlines. I like the whooshing sound they make as they fly by.
- Douglas Adams

說Java好的是因為它跨平臺就像好像說肛交好是因為其可以適用於一切性別。Saying that Java is good because it works on all platforms is like saying anal sex is good because it works on all genders
- Unknown

XML就像是一種強暴——如果它不能解決你的問題,那隻能說明你沒有用好它。XML is like violence – if it doesn’t solve your problems, you are not using enough of it.
- Unknown

愛因期坦說,自然界中的一切一定會有一個簡單的解釋,因為上帝並不是反覆無常和獨裁的。當然,不會有什麼信仰能程式設計師像愛因期坦那樣感到舒服。Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer.
- Fred Brooks

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill 
 “最開始的90%的程式碼使用了程式設計師90%的時間,剩下的10%的程式碼也需要90%的開發時間”——Tom Cargill(這不就是中國諺語——“行百步半九十”)

“In order to understand recursion, one must first understand recursion.” – Author Unknown 
 “要知道什麼是‘遞迴’,你首先需要知道‘遞迴’”——無名氏

“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.” – Bjarne Stroustrup 
“我總是希望電腦能和電話一樣好用,現在我的這個願望成真了,因為我已經不知道怎麼使用我的電話了”– Bjarne Stroustrup

 “There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.” -C.A.R. Hoare
“我們有兩個方法來進行軟體設計:一個是讓其足夠的簡單以至於讓BUG無法藏身;另一個就是讓其足夠的複雜,讓人找不到BUG。前者更難一些” — C.A.R. Hoare

  “If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.” – Gerald Weinberg
“如果建築工人蓋房子就像程式設計師寫程式一樣,那麼只需要一隻啄木鳥就可以摧毀人類文明”– Gerald Weinberg

“Nine people can’t make a baby in a month.” – Fred Brooks 
“九個人不能只用一個月就能生出孩子來”– Fred Brooks (這是對人月計演算法的一個諷刺)

“Before software can be reusable it first has to be usable.” – Ralph Johnson
“在軟體可被重用前,它必需要可以被用”– Ralph Johnson

程式設計師之歌
99 little bugs in the code,
99 bugs in the code,
fix one bug, compile it again,
101 little bugs in the code.
101 little bugs in the code….
(Repeat until BUGS = 0)

Any fool can write code that a computer can understand. Good programmers write code that humans can understand. –Martin Fowler
任何一個傻子都能寫出讓電腦能懂的程式碼,而只有好的程式設計師可以寫出讓人能看懂的程式碼 — Martin Fowler

Wirth’s law: Software gets slower faster than hardware gets faster. –Niklaus Wirth
Wirth定律,軟體把效能變慢的速度要快於硬體把性期變快的速度。– Niklaus Wirth

 Better train people and risk they leave – than do nothing and risk they stay.
Anonymous
就算是培訓的員工會離開,這也好過他們什麼也不做卻不會離開。——無名氏

Good judgment comes from experience, and experience comes from bad judgment. –Frederick P. Brooks
“好的判斷來自於經驗,而經驗則來自於壞的判斷”

UNIX is simple. It just takes a genius to understand its simplicity –Dennis Ritchie
UNIX 簡單的,但只有天才才能知道他的簡單 — Dennis Rithie

Unix was not designed to stop people from doing stupid things, because that would also stop them from doing clever things.  –Doug Gwyn
Unix 並不是設計成——阻止人們做那些愚蠢的事,因為那同樣會阻止人們做聰明的事。——Doug Gwyn

如果你想看更多這樣的引言,你可以瀏覽下面這個網頁:
http://www.comp.nus.edu.sg/~damithch/pages/SE-quotes.htm

相關文章