歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> Linux文化 >> 《編程之道》(小趙譯版)

《編程之道》(小趙譯版)

日期:2017/2/27 12:16:23   编辑:Linux文化

說明:
  本文是<<編程之道>> <<編程之禅>><<計算機時代的寓言>>其中的一冊, 由 小趙翻譯整理, 另外, 這三冊書的完整電子文檔由小趙根據市面上的<< 編程之道>>一書(包括了上面的三卷)錄入整理, 隨後將一起刊登(參見《編程之道》全譯文)。

Table of Contents 目錄 Book 1 -- The Silent Void Book 2 -- The Ancient Masters Book 3 -- Design Book 4 -- Coding Book 5 -- Maintenance Book 6 -- Management Book 7 -- Corporate Wisdom Book 8 -- Hardware and Software Book 9 -- Epilogue

The Silent Void
Book One

Thus spake the master programmer:
編程大師如是說:

"When you have learned to snatch the error code from the trap frame, it will be time for you to leave."
“當你從我手中奪走水晶球時,就是你離開的時候了。” 1.1 Something mysterious is formed, born in the silent void. Waiting alone and unmoving, it is at once still and yet in constant motion. It is the source of all programs. I do not know its name, so I will call it the Tao of Programming.
寂靜的虛空裡誕生了神秘的東西,這種東西恆久存在永不消失,它是所有程序的 根源所在,我不知道怎麼形容它,姑且稱它為編程之道。

If the Tao is great, then the operating system is great. If the operating system is great, then the compiler is great. If the compiler is greater, then the applications is great. The user is pleased and there is harmony in the world.
如果道是完美的,那麼操作系統就是完美的,如果操作系統是完美的,那麼編譯 囂就是完美的,如果編譯囂是完美的,那麼應用程序就是完美的,所以用戶心滿意 足,整個世界因此和諧。

The Tao of Programming flows far away and returns on the wind of morning.
編程之道去如黃鶴來如晨風。 1.2 The Tao gave birth to machine language. Machine language gave birth to the assembler.
道生機器語言,機器語言生匯編囂。

The assembler gave birth to the compiler. Now there are ten thousand languages.
匯編器生編譯器,最後產生上萬種高級語言。

Each language has its purpose, however humble. Each language expresses the Yin and Yang of software. Each language has its place within the Tao.
不論多麼的微不足道,每種語言都有它自己的目的,每種語言都表達了軟件的陰 陽兩極。每種語言都各得其道。

But do not program in COBOL if you can avoid it.
但是盡量不要用COBOL語言。 1.3 In the beginning was the Tao. The Tao gave birth to Space and Time. Therefore, Space and Time are the Yin and Yang of programming.
道之初,帶來了空間和時間,所以,空間和時間是編程的陰陽兩極。

Programmers that do not comprehend the Tao are always running out of time and space for their programs. Programmers that comprehend the Tao always have enough time and space to accomplish their goals.
不懂編程之道的程序員常常把空間和時間消耗殆盡,得道的程序員則總是有足夠 的空間和時間去完成編程任務。

How could it be otherwise?
否則會是什麼樣呢? 1.4 The wise programmer is told about the Tao and follows it. The average programmer is told about the Tao and searches for it. The foolish programmer is told about the Tao and laughs at it.
上士聞道,從而行之。 中士聞道,謹而尋之。 下士聞道,大笑之。

If it were not for laughter, there would be no Tao.
大笑不足為道。

The highest sounds are the hardest to hear. Going forward is a way to retreat. Greater talent shows itself late in life. Even a perfect program still has bugs.
希音不聞,進即是退,大囂晚成。 任何程序都有漏洞。

The Ancient Masters
Book Two

Thus spake the master programmer:
編程大師如是說:

"After three days without programming, life becomes meaningless."
三日不編程,食肉無味。

2.1 The programmers of old were mysterious and profound. We cannot fathom their thoughts, so all we do is describe their appearance.
遠古時代的編程大師們高深莫測,我們不能揣測他們的所思所想,只能描述外表 所見。

Aware, like a fox crossing the water. Alert, like a general on the battlefield. Kind, like a hostess greeting her guests. Simple, like uncarved blocks of wood. Opaque, like black pools in darkened caves.
他達明,如狐狸過水;機警,如戰場上的將軍;和善,如主婦款待客人;簡單, 呆若木雞;混沌,如深淵之水。

Who can tell the secrets of their hearts and minds?
誰能道盡他們的所有?

The answer exists only in the Tao.
答案僅存於道。 2.2 Grand Master Turing once dreamed that he was a machine. When he awoke he exclaimed:
超級大師圖靈曾夢見自己是一台機器,醒後他這樣回憶:

"I don't know whether I am Turing dreaming that I am a machine, or a machine dreaming that I am Turing!"

“我不知道是圖靈夢見自己變成機器還是機器夢見自己變成圖靈。” 2.3 A programmer from a very large computer company went to a software conference and then returned to report to his manager, saying: "What sort of programmers work for other companies? They behaved badly and were unconcerned with appearances. Their hair was long and unkempt and their clothes were wrinkled and old. They crashed out hospitality suites and they made rude noises during my presentation."
一個大公司的程序員參加一個軟件會議後向他的主管匯報:“那些別的公司的 程序員都是些什麼樣的人呀?他們舉止不雅,不修邊幅,頭發蓬亂,衣服破舊, 根本不熱情好客,還在我說話的時候亂嚷嚷。”

The manager said: "I should have never sent you to the conference. Those programmers live beyond the physical world. They consider life absurd, an accidental coincidence. They come and go without knowing limitations. Without a care, they live only for their programs. Why should they bother with social conventions?"
他的主管說:“我不應該讓你參加這次會議,這些程序員生活在現實世界之外。 他們認為生活是可笑的,一場意外的偶然而已。他們來去自由,無所牽掛,他們 只為他們的程序生活。為什麼要用世俗的煩擾去擾亂他們呢?”

"They are alive within the Tao."
“他們生活在道中”。 2.4 A novice asked the Master: "Here is a programmer that never designs, documents, or tests his programs. Yet all who know him consider him one of the best programmers in the world. Why is this?"
一個初學者問主管經理:“有一個程序員,他從來不預先設計,也不寫文檔,甚至 不測試他的程序,但是知道他的人都認為他是世界上最偉大的程序員,為什麼呢?”

The Master replies: "That programmer has mastered the Tao. He has gone beyond the need for design; he does not become angry when the system crashes, but accepts the universe without concern. He has gone beyond the need for documentation; he no longer cares if anyone else sees his code. He has gone beyond the need for testing; each of his programs are perfect within themselves, serene and elegant, their purpose self-evident. Truly, he has entered the mystery of the Tao."
經理說:“那個程序員掌握了道。他不需要預先進行設計;系統崩潰時他也從不 煩燥,只是接受發生的一切而不管發生的事是好是壞 。他不需要寫文檔,他從不 顧及有沒有人看他寫的代碼。他也不需要進行測試;他寫的每個程序都有一個完 美的自我,平靜而優雅,它們的目的不言自明。他已經真正掌握了道的精髓。” Design
Book Three

Thus spake the master programmer:
編程大師如是說: "When program is being tested, it is too late to make design changes."

“程序被測試時再去改變它的設計已經太晚了。” 3.1 There once was a man who went to a computer trade show. Each day as he entered, the man told the guard at the door:
曾經有一個人參加計算機展覽,每天他進門時都對門衛說:

"I am a great thief, renowned for my feats of shoplifting. Be forewarned, for this trade show shall not escape unplundered."
“先警告你,我是偷盜高手,我入室偷盜的本領聞名遐迩。這次展覽會也再劫難 逃。”

This speech disturbed the guard greatly, because there were millions of dollars of computer equipment inside, so he watched the man carefully. But the man merely wandered from booth to booth, humming quietly to himself.
警衛因此大動干戈,因為裡面有價值百萬的計算機設備,所以他牢牢盯緊了這個人 ,但是這個人只是從一個攤位逛到另一個攤位,一邊平靜地喃喃自語。

When the man left, the guard took him aside and searched his clothes, but nothing was to be found.
當這個人離開時,警衛搜了他的身,但是什麼也沒有發現。

On the next day of the trade show, the man returned and chided the guard saying: "I escaped with a vast booty yesterday, but today will be even better." So the guard watched him ever more closely, but to no avail.
展覽會的第二天,這個人又對警衛說:“昨天我滿載而歸,但是今天我會收獲更 大。”所以警衛更加小心地盯緊他,但是這樣做完全於事無補。

On the final day of the trade show, the guard could restrain his curiosity no longer. "Sir Thief," he said, "I am so perplexed, I cannot live in peace. Please enlighten me. What is it that you are stealing?"
展覽會的最後一天,警衛再也不能忍住他的好奇心了。“小偷先生,”他說,“ 你說我驚慌不安,請告訴我,你到底偷了什麼?”。

The man smiled. "I am stealing ideas," he said.
這個人笑笑說:“我在偷想法。” 3.2 There once was a master programmer who wrote unstructured programs. A novice programmer, seeking to imitate him, also began to write unstructured programs. When the novice asked the master to evaluate his progress, the master criticized him for writing unstructured programs, saying: "What is appropriate for the master is not appropriate for the novice. You must understand the Tao before transcending structure."
有一位編程大師,他寫非結構化的程序,一位初學者刻意模仿他,也寫非 結構化的程序。當他讓大師看他的進步時,大師批評了他的非結構化程序:“ 對一位編程大師合適的東西未必對一個初學者同樣合適,在超越結構化之前,你 必須理解編程之道。” 3.3 There was once a programmer who was attached to the court of the warlord of Wu. The warlord asked the programmer: "Which is easier to design: an accounting package or an operating system?"
###有人問一位程序員,“一個財務軟件和一個操作系統哪個更容易設計?”

"An operating system," replied the programmer.
“是操作系統”,這位程序員回答說。

The warlord uttered an exclamation of disbelief. "Surely an accounting package is trivial next to the complexity of an operating system," he said.
此人大惑不解。他說:“顯然一個財務軟件比起操作系統來說其復雜性是微不足道 的”。

"Not so," said the programmer, "when designing an accounting package, the programmer operates as a mediator between people having different ideas: how it must operate, how its reports must appear, and how it must conform to the tax laws. By contrast, an operating system is not limited my outside appearances. When designing an operating system, the programmer seeks the simplest harmony between machine and ideas. This is why an operating system is easier to design."
程序員說:“不,設計財務軟件時,一個程序員必須成為持不同意見的用戶與計算 機的一個中介,他必須了解用戶的操作習慣,報表要是什麼形式,如何遵循稅法。 相反,一個操作系統完全與這些外部的東西無關。設計操作系統,程序員只需要 達到自己的設想與機器之間的簡單的和諧。這就是為什麼操作系統反而比財務軟件 更容易設計。”

The warlord of Wu nodded and smiled. "That is all good and well, but which is easier to debug?"
這些人笑著說。“不錯,但是哪一個更容易調試呢?”

The programmer made no reply.
程序員沒有回答。 3.4 A manager went to the master programmer and showed him the requirements document for a new application. The manager asked the master: "How long will it take to design this system if I assign five programmers to it?"
一個項目經理帶給編程大師一個項目的需求,然後問大師:“如果我給你5個程序 員,要多少時間設計這個項目?”

"It will take one year," said the master promptly.
“一年”,大師說。

"But we need this system immediately or even sooner! How long will it take it I assign ten programmers to it?"
“但是我們等不了那麼長時間,越快越好,如果10程序員呢?”

The master programmer frowned. "In that case, it will take two years."
大師皺了一下眉頭說:“那就要花2年”。

"And what if I assign a hundred programmers to it?"
“那,100年程序員呢?”

The master programmer shrugged. "Then the design will never be completed," he said.
大師聳了聳肩說:“那這個項目就永遠完不成了。”

Coding
Book Four

Thus spake the master programmer:
編程大師如是說: "A well-written program is its own heaven;
a poorly-written program is its own hell."
“寫的好的程序是它自己的天堂,寫的不好的程序是它自己的地獄”

4.1 A program should be light and agile, its subroutines connected like a strings of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little nor too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity.
一個程序應該是輕靈自由的,它的子過程就象串在一根線上的珍珠。自始至終, 目標明確。增之一字節則太長,減之一字節則太短。既沒有不必要的循環也沒有 沒有被引用的變量,既不缺少結構化也不至於僵硬呆板。

A program should follow the Law of Least Astonishment. What is this law? It is simply that the program should always respond to the user in the way that astonishes him least.
一個程序應該遵循``最小驚訝原則'',什麼是``最小驚訝原則''?就是說一個程序 應該最小程度地引起用戶的驚訝。

A program, no matter how complex, should act as a single unit. The program should be directed by the logic within rather than by outward appearances.
無論一個程序無論有多麼復雜都應該是一個單一的整體。程序是被它的內部邏輯 所指引而不是它的外觀表現。

If the program fails in these requirements, it will be in a state of disorder and confusion. The only way to correct this is to rewrite the program.
如果一個程序不能滿足所要的需求,它就會處於混亂無序的狀態中。唯一的出路 就是重寫這個程序。 4.2 A novice asked the master: "I have a program that sometimes runs and sometimes aborts. I have followed the rules of programming, yet I am totally baffled. What is the reason for this?"
一個初學者問大師:“我的一個程序有時正常有時不正常。我已經完全遵循編程 的規則,而且我完全被它弄糊塗了,到底是什麼原因會導致這樣呢?”

The master replied: "You are confused because you do not understand the Tao. Only a fool expects rational behavior from his fellow humans. Why do you expect it from a machine that humans have constructed? Computers simulate determinism; only the Tao is perfect.
大師說:“你困惑是因為你不了解道。只有傻瓜才會相信只要遵循別人所說就能 得到想當然的結果。為什麼你要從一個人類自己構造的機器中去得到想當然的結果 呢?計算機只是決定論的產物;只有道才是唯一完美的。

The rules of programming are transitory; only the Tao is eternal. Therefore you must contemplate the Tao before you receive enlightenment."
任何編程的規則都只適合於特定的情況,只有道才是永恆不變的。所以在你受到 指引之前要先去思考道。”

"But how will I know when I have received enlightenment?" asked the novice.
“但是我怎麼知道我何時受到指引呢?”

"Your program will then run correctly," replied the master.
“當你的程序正確運行時”。大師說。 4.3 A master was explaining the nature of the Tao to one of his novices, "The Tao is embodied in all software -- regardless of how insignificant," said the master.
初學者請大師解釋“道法自然”。 大師說:“道存在於任何軟件中--無論是多麼沒有意義的軟件”。

"Is the Tao in a hand-held calculator?" asked the novice.
“難道也存在於手持式的計算囂裡?”,初學者問。

"It is," came the reply.
“是的,”

"Is the Tao in a video game?" continued the novice.
“也在游戲機裡?”,初學者又問到。

"It is even in a video game," said the master.
“是的,甚至也存在於游戲機裡”。大師說。

"And is the Tao in the DOS for a personal computer?"
“也存在於個人計算機的DOS裡嗎?”

The master coughed and shifted his position slightly. "The lesson is over for today," he said.
大師咳嗽了一聲,稍微動了一下,說,“今天的課就到這裡”。 4.4 Price Wang's programmer was coding software. His fingers danced upon the keyboard. The program compiled without an error message, and the program ran like a gentle wind.
###編程大師編寫軟件時,手指在鍵盤上快速飛舞。程序編譯時沒有一條錯誤信息 ,程序運行起來就象一陣微風吹過。

Excellent!" the Price exclaimed, "Your technique is faultless!"
太精彩了!你的技巧已經無可挑剔了。

"Technique?" said the programmer, turning from his terminal, "What I follow is the Tao -- beyond all technique. When I first began to program I would see before me the whole program in one mass. After three years I no longer saw this mass. Instead, I used subroutines. But now I see nothing. My whole being exists in a formless void. My senses are idle. My spirit, free to work without a plan, follows its own instinct. In short, my program writes itself. True, sometimes there are difficult problems. I see them coming, I slow down, I watch silently. Then I change a single line of code and the difficulties vanish like puffs of idle smoke. I then compile the program. I sit still and let the joy of the work fill my being. I close my eyes for a moment and then log off."
“技巧?”,大師轉過身說,“我所遵循的是道--它超乎所有的技巧。當我開始 編程時我看到的是整個一大塊的程序,三年後我看到的是子過程。現在我什麼也 看不到了。我的整個存在是沒有任何形式的虛無。我感覺很悠閒,總之,事實上是 我的程序自己在寫,有時我看到一些問題,我看到它們,就停下來靜靜地觀察它們 ,然後我改變了一行代碼,難題就象一陣輕煙一樣化為烏有。然後我編譯程序。 坐在那裡享受工作的喜悅。閉了一會眼睛然後退出系統。

Price Wang said, "Would that all of my programmers were as wise!"
“什麼時候我的程序員才能都達到這樣的境界!”

Mainteance
Book Five

Thus spake the master programmer:
編程大師如是說: "Though a program be but three lines long, someday it will have to be maintained."
“既使一個程序只有三行長,也總有一天需要去維護它”

5.1 A well-used door needs no oil on its hinges.
A swift-flowing steam does no grow stagnant.
Neither sound nor thoughts can travel through a vacuum.
Software rots if not used.

經常使用的門不需要往門軸裡上油。
流動的東西就不會停滯不前。
流水不腐,戶樞不蠹。--王磊
聲音和思想都不能在真空裡傳播。
軟件不用就會腐朽。

These are great mysteries.
5.2 A manager asked a programmer how long it would take him to finish the program on which he was working. "I will be finished tomorrow," the programmer promptly replied.
經理問程序員要多長時間才能完成他的項目。“明天”

"I think you are being unrealistic," said the manager. "Truthfully, how long will it take?"
“太不著邊際了,老實說,要多久?”

The programmer thought for a moment. "I have some features that I wish to add. This will take at least two weeks," he finally said.
程序員想了一想說。“還有一些新的功能要加進去,可能至少要兩個星期吧。”

"Even that is too much to expect," insisted the manager, "I will be satisfied if you simply tell me when the program is complete."
“即使兩個星期恐怕也太誇張了,什麼時候你只要告訴我說程序已經完成就好了。”

The programmer agreed to this.

Several years slated, the manager retired. On the way to his retirement lunch, he discovered the programmer asleep at his terminal. He had been programming all night.
幾年後,這個經理已經退休了,在他的離職午餐上,他發現這些程序員在他的終端 前睡著了,他整夜都在編程。 5.3 A novice programmer was once assigned to code a simple financial package.
一個初學者被要求編寫一個財務軟件。

The novice worked furiously for many days, but when his master reviewed his program, he discovered that it contained a screen editor, a set of generalized graphics routines, and artificial intelligence interface, but not the slightest mention of anything financial.
他瘋狂地工作了很多天,但他的主管檢視他的程序時發現,它寫了一個編輯囂, 一個圖形程序集,和人工智能的界面,但是看不到任何跟財務有關的東西。

When the master asked about this, the novice became indignant. "Don't be so impatient," he said, "I'll put the financial stuff in eventually."
主管要求解釋時,程序員被激怒了:“你太沒耐心了,我會在最後寫財務的部分。” 5.4 Does a good farmer neglect a crop he has planted?
Does a good teacher overlook even the most humble student?
Does a good father allow a single child to starve?
Does a good programmer refuse to maintain his code?

一個好的農民不會不管他的莊稼。
一個好的老師不會不管哪怕是最差的學生。
一個好的父親不會讓他的任何一個孩子挨餓。
一個好的程序員不應拒絕維護他的程序。

Management
Book Six

Thus spake the master programmer:
編程大師如是說: "Let the programmer be many and the managers few -- then all will be productive."
“增加程序員,減少經理--這樣他們都可提高效率。” 6.1 When managers hold endless meetings, the programmers write games. When accountants talk of quarterly profits, the development budget is about to be cut. When senior scientists talk blue sky, the clouds are about to roll in.
經理們忙於無休無止的會議時,程序員們在寫游戲。財務主管在談論季度盈利時 開發預算將會被削減。當老科學家在談天空的藍色時,雲團蜂擁而至。

Truly, this is not the Tao of Programming.
這不是編程之道。

When managers make commitments, game programs are ignored. When accountants make long-range plans, harmony and order are about to be restored. When senior scientists address the problems at hand, the problems will soon be solved.
經理分配任務時不會包括游戲,會計師做長期計劃時,應該做到面面俱到,皆大 歡喜。科學家提出一個問題,就會很快得到解決。

Truly, this is the Tao of Programming.
這才是編程之道。 6.2 Why are programmers non-productive? Because their time is wasted in meetings.
為什麼程序員沒有效率,因為他們把時間都浪費在開會上了。

Why are programmers rebellious? Because the management interferes too much.
為什麼程序員難於管理? 因為管理者的干預 太多了。

Why are the programmers resigning one by one? Because they are burnt out.
為什麼程序員一個接一個地辭職,因為他們累壞了。

Having worked for poor management, they no longer value their jobs.
在糟糕的管理下工作,他們享受不到工作的樂趣。 6.3 A manager was about to be fired, but a programmer who worked for him invented a new program that became popular and sold well. As a result, the manager retained his job.
一個經理將被解雇,但他手下的一個程序員寫了一個流行的軟件並且銷路很旺。 所以經理保住了他的工作。

The manager tried to give the programmer a bonus, but the programmer refused it, saying, "I wrote the program because I though it was an interesting concept, and thus I expect no reward."
經理為程序員分紅,但程序員拒絕了,他說:“我寫程序是因為 寫程序很有趣,所以我並沒想過得資金”。

The manager, upon hearing this, remarked, "This programmer, though he holds a position of small esteem, understands well the proper duty of an employee. Lets promote him to the exalted position of management consultant!"
這位經理說,“這位程序員,不管他現在是什麼位置,他都能理解一個雇員的 職責所在。我們要把他提升為管理顧問”。

But when told this, the programmer once more refused, saying, "I exist so that I can program. If I were promoted, I would do nothing but waste everyone's time. Can I go now? I have a program that I'm working one."
這位程序員又一次拒絕了,他說:“我是一個程序員所以我可以編程,如果我被 提升了,除了浪費別人的時間什麼也做不了,現在我可以走了嗎?我還有一個程序 沒寫完。” 6.4 A manger went to his programmers and told them: "As regards to your work hours: you are going to have to come in at nine in the morning and leave at five in the afternoon." At this, all of them became angry and several resigned on the spot.
經理對程序員說,“你們的工作時間是早上9點到正午點。”,所有的程序員都 很不滿。

So the manager said: "All right, in that case you may set your own working hours, as long as you finish your projects on schedule." The programmers, now satisfied, began to come in a noon and work to the wee hours of the morning.
經理又說:“好吧,那隨你們的便,只要能按時完成任務。”,程序員們這下滿意 了,他們中午上班,一直工作到凌晨。

Corporate Wisdom
Book Seven

Thus spake the master programmer:
編程大師如是說: "You can demonstrate a program for a corporate executive, but you can't make him computer literate." ###
“你可以向一位公司主管演示一套程序,但你不能讓他的電腦變得象人一樣。” 7.1 A novice asked the master: "In the east there is a great tree-structure that men call 'Corporate Headquarters'. It is bloated out of shape with vice-presidents and accountants. It issues a multitude of memos, each saying 'Go, Hence!' or 'Go, Hither!' and nobody knows what is meant. Every year new names are put onto the branches, but all to no avail. How can such an unnatural entity exist?"
一個新學問大師:“在東方,有一個龐大的機構,人們稱作總部。它由為數眾多 的大小領導。每天發出大量的 備忘錄,每個備忘錄都說:‘干這個,干那個’,沒有一個人知道它是什麼意思。 每年這個機構都會有更多的人加進來而變得越來越大,但是去沒有人去做事情。 怎麼燴樣奇怪的東西還能存在呢?”

The master replies: "You perceive this immense structure and are disturbed that it has no rational purpose. Can you not take amusement from its endless gyrations? Do you not enjoy the untroubled ease of programming beneath its sheltering branches? Why are you bothered by its uselessness?"
大師說:“你已經知道這個巨大的機構並不合理,你就不能不管它為什麼這樣嗎? 你盡管享受它的好處就是了,干嗎要去管它到底是沒有效率呢?” 7.2 In the east there is a shark which is larger than all other fish. It changes into a bird whose winds are like clouds filling the sky. When this bird moves across the land, it brings a message from Corporate Headquarters. This message it drops into the midst of the program- mers, like a seagull making its mark upon the beach. Then the bird mounts on the wind and, with the blue sky at its back, returns home.
在遙遠的東方,傳說有一只巨大的魚,叫鲲,它變成了一 只大鳥,叫鵬,鵬的翅膀可以遮天蔽日,這只大鳥經過陸地的時候,它帶來了一個 消息,它把這個消息丟在程序員中,就象一只海鷗在海灘上做的記號,然後鵬背負 藍天,乘風而上,回家去了。

The novice programmer stares in wonder at the bird, for he understands it not. The average programmer dreads the coming of the bird, for he fears its message. The master programmer continues to work at his terminal, for he does not know that the bird has come and gone.
初學者驚恐地看著這只鳥,根本不敢相信,中級程序員 擔心這只鳥的到來,因為它害怕它帶來的消息,編程大師則繼續在他的終端前工作 他根本不知道這只鳥曾經來過。 7.3 The Magician of the Ivory Tower brought his latest invention for the master programmer to examine. The magician wheeled a large black box into the master's office while the master waited in silence.
一個學究帶著他的最新發明去見編程大師,他把一個大黑盒子推進大師的辦公室。

"This is an integrated, distributed, general-purpose workstation," began the magician, "ergonomically designed with a proprietary operating system, sixth generation languages, and multiple state of the art user interfaces. It took my assistants several hundred man years to construct. Is it not amazing?"
“這是綜合的、分布式的通用工作站,”,學究開始介紹了,“按人體工學設計 的操作系統,第六代的高級語言,多樣的用戶界面,整整花了我的助手好幾百人年 的時間,挺不錯吧?”

The master raised his eyebrows slightly. "It is indeed amazing," he said.
大師揚了一下眉毛,說:“的確很了不起。”

"Corporate Headquarters has commanded," continued the magician, "that everyone use this workstation as a platform for new programs. Do you agree to this?"
“頭兒已經說了,”這位學究繼續說,“每個人都要用這個工作站作平台,你覺得 怎麼樣?”

"Certainly," replied the master, "I will have it transported to the data center immediately!" And the magician returned to his tower, well pleased.
“當然了,”,大師回答說,“我要馬上把它送到數據中心去!”,這位學究滿 意去回去了。

Several days later, a novice wandered into the office of the master programmer and said, "I cannot find the listing for my new program. Do you know where it might be?"
幾天後,一個新手走進大師的辦公室說,“我找不到我新寫的程序了,你知道它 可能會在哪兒嗎?”

"Yes," replied the master, "the listings are stacked on the platform in the data center."
“當然,”,大師說,“你的程序在數據中心的平台裡放著。” 7.4 The master programmer moves from program to program without fear. No change in management can harm him. He will not be fired, even if the project is canceled. Why is this? He is filled with the Tao.
編程大師從一個項目轉到另一個項目而豪無顧慮,任何管理上的變動都不能影響 他,他不會被解雇,即使項目被取消了。為什麼呢?他了解了道。

Hardware and Software
Book Eight

Thus spake the master programmer: "Without the wind, the grass does not move.
Without software, hardware is useless."
風不動則草不動,
沒有軟件,硬件只是一堆發熱的電子器件 8.1 A novice asked the master: "I perceive that one computer company is much larger than all others. It towers above its competition like a giant among dwarfs. Any one of its divisions could comprise an entire business. Why is this so?"
一個初學者問編程大師:“我知道有一家計算機公司比 所有其它的公司都大。在它面前它的競爭對手就象站在巨人面前的侏儒。它的任 一部門都有各自的業務,為什麼會這樣呢?”

The master replied, "Why do you ask such foolish questions? That company is large because it is so large. If it only made hardware, nobody would buy it. If it only maintained systems, people would treat it like a servant. But because it combines all of these things, people think it one of the gods! By not seeking to strive, it conquers without effort."
大師說,“為什麼你問如此愚蠢的問題呢?那家公司大 是因為它就是如此之大,如果它只做硬件,就沒有人會買,如果它只維護系統, 人們只會把它當作僕人,但是它的業務囊括了所有這些東西,人們就對它頂禮莫拜 好象不用努力奮斗就可擊敗競爭對手 8.2 A master programmer passed a novice programmer one day. The master noted the novice's preoccupation with a hand-held computer game. "Excuse me", he said, "may I examine it?"
有一天編程大師碰見了一個正玩掌上游戲機的編程新手, 他說:“給我看一下?”

The novice bolted to attention and handed the device to the master. "I see that the device claims to have three levels of play: Easy, Medium, and Hard", said the master. "Yet every such device has another level of play, where the device seeks not to conquer the human, nor to be conquered by the human."
新手把游戲機遞給大師,“我看到上面說明了三種難度的 玩法:容易,中等,高難”,大師說,“但是每個這樣的游戲機都有另外一種玩法 ,此時游戲機即不是想著怎麼贏你,也不是怎麼被你贏。”

"Pray, great master," implored the novice, "how does one find this mysterious setting?"
“那麼請問大師”,初學者說,“這種玩法到底是怎樣玩 的呢?”

The master dropped the device to the ground and crushed it under foot. And suddenly the novice was enlightened.
大師把游戲機摔到地下然後用腳踩碎它,突然初學者明白 了。 8.3 There was once a programmer who worked upon microprocessors. "Look at how well off I am here," he said to a mainframe programmer who came to visit, "I have my own operating system and file storage device. I do not have to share my resources with anyone. The software is self-consistent and easy-to-use. Why do you not quit your present job and join me here?"
有一個工作在微機上的程序員對前來參觀的大型機程序員 說:“看看我這裡吧,我有自己的操作系統和文件存儲設備,我不需要與別人共享 任何資源,軟件條條有理並且易於操作。為什麼你不辭去你的工作到這裡來呢?”

The mainframe programmer then began to describe his system to his friend, saying: "The mainframe sits like an ancient sage meditating in the midst of the data center. Its disk drives lie end-to-end like a great ocean of machinery. The software is a multi-faceted as a diamond and as convoluted as a primeval jungle. The programs, each unique, move through the system like a swift-flowing river. That is why I am happy where I am."
大型機的程序員對他的朋友說:“大型機就象古代聖賢 一樣深思熟慮,它的磁盤設備從頭到尾就象是一個巨大的機械設備的海洋。軟件 象鑽石一樣有多個面,象遠古的森林一樣令人費解。每一個程序都象水經過河流一 樣穿行於系統中,那就是為什麼我樂於為它工作”

The microcomputer programmer, upon hearing this, fell silent. But the two programmers remained friends until the end of their days.
微機程序員聽了這些話後,默默不語,但這兩個程序員 至死都是很好的朋友 8.4 Hardware met Software on the road to Changtse. Software said: "You are the Yin and I am the Yang. If we travel together we will become famous and earn vast sums of money." And so the pair set forth together, thinking to conquer the world.
硬件和軟件在路上碰見了,軟件說:“你是陰我是陽,如 果我們聯手就可以賺大錢。”所以它們走到了一直,考慮怎樣征服世界。

Presently, they met Firmware, who was dressed in tattered rags, and hobbled along propped on a thorny stick. Firmware said to them: "The Tao lies beyond Yin and Yang. It is silent and still as a pool of water. It does not seek fame, therefore nobody knows its presence. It does not seeks fortune, for it is complete within itself. It exists beyond space and time."
不久,它們遇到了固件,固件衣衫褴褛,拄著一根拐棍 步履蹒跚。固件對它們說:“道在於陰陽之外。它靜如止水,它從不指望能揚名 遠近,所以沒有人知道它的存在。它也不尋求幸福,它只是與它自己的存在在一起 ,它存在於空間和時間之外。”

Software and Hardware, ashamed, returned to their homes.
軟件和硬件面有慚色,各自回了家。

Epilogue
Book Nine

Thus spake the master programmer: 編程大師如是說: "Time for you to leave."
“現在是你出師的時候了。”


Copyright © Linux教程網 All Rights Reserved