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.
µÀÖ®³õ£¬´øÀ´ÁË¿Õ¼äºÍʱ¼ä£¬ËùÒÔ£¬¿Õ¼äºÍʱ¼äÊDZà³ÌµÄÒõÑôÁ½¼«¡£
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.
Ô¶¹Åʱ´úµÄ±à³Ì´óʦÃǸßÉîĪ²â£¬ÎÒÃDz»ÄÜ´§²âËûÃǵÄËù˼ËùÏ룬ֻÄÜÃèÊöÍâ±í
Ëù¼û¡£
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?"
ËûµÄÖ÷¹Ü˵£º¡°ÎÒ²»Ó¦¸ÃÈÃÄã²Î¼ÓÕâ´Î»áÒ飬ÕâЩ³ÌÐòÔ±Éú»îÔÚÏÖʵÊÀ½çÖ®Íâ¡£
ËûÃÇÈÏΪÉú»îÊÇ¿ÉЦµÄ£¬Ò»³¡ÒâÍâµÄżȻ¶øÒÑ¡£ËûÃÇÀ´È¥×ÔÓÉ£¬ÎÞËùÇ£¹Ò£¬ËûÃÇ
ֻΪËûÃǵijÌÐòÉú»î¡£ÎªÊ²Ã´ÒªÓÃÊÀË׵ķ³ÈÅÈ¥ÈÅÂÒËûÃÇÄØ£¿¡±
"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.
¡°ÊDzÙ×÷ϵͳ¡±£¬Õâλ³ÌÐòÔ±»Ø´ð˵¡£
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.
ÎÞÂÛÒ»¸ö³ÌÐòÎÞÂÛÓжàô¸´ÔÓ¶¼Ó¦¸ÃÊÇÒ»¸öµ¥Ò»µÄÕûÌå¡£³ÌÐòÊDZ»ËüµÄÄÚ²¿Âß¼
ËùÖ¸Òý¶ø²»ÊÇËüµÄÍâ¹Û±íÏÖ¡£
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.
´óʦ˵£º¡°ÄãÀ§»óÊÇÒòΪÄã²»Á˽âµÀ¡£Ö»ÓÐɵ¹Ï²Å»áÏàÐÅÖ»Òª×ñѱðÈËËù˵¾ÍÄÜ
µÃµ½Ï뵱ȻµÄ½á¹û¡£ÎªÊ²Ã´ÄãÒª´ÓÒ»¸öÈËÀà×Ô¼º¹¹ÔìµÄ»úÆ÷ÖÐÈ¥µÃµ½Ï뵱ȻµÄ½á¹û
ÄØ£¿¼ÆËã»úÖ»ÊǾö¶¨Â۵IJúÎֻÓеÀ²ÅÊÇΨһÍêÃÀµÄ¡£
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."
¡°¼¼ÇÉ£¿¡±£¬´óʦת¹ýÉí˵£¬¡°ÎÒËù×ñѵÄÊǵÀ--Ëü³¬ºõËùÓеļ¼ÇÉ¡£µ±ÎÒ¿ªÊ¼
±à³ÌʱÎÒ¿´µ½µÄÊÇÕû¸öÒ»´ó¿éµÄ³ÌÐò£¬ÈýÄêºóÎÒ¿´µ½µÄÊÇ×Ó¹ý³Ì¡£ÏÖÔÚÎÒʲôҲ
¿´²»µ½ÁË¡£ÎÒµÄÕû¸ö´æÔÚÊÇûÓÐÈκÎÐÎʽµÄÐéÎÞ¡£ÎҸоõºÜÓÆÏУ¬×ÜÖ®£¬ÊÂʵÉÏÊÇ
ÎҵijÌÐò×Ô¼ºÔÚд£¬ÓÐʱÎÒ¿´µ½Ò»Ð©ÎÊÌ⣬ÎÒ¿´µ½ËüÃÇ£¬¾ÍÍ£ÏÂÀ´¾²¾²µØ¹Û²ìËüÃÇ
£¬È»ºóÎҸıäÁËÒ»ÐдúÂ룬ÄÑÌâ¾ÍÏóÒ»ÕóÇáÑÌÒ»Ñù»¯ÎªÎÚÓС£È»ºóÎÒ±àÒë³ÌÐò¡£
×øÔÚÄÇÀïÏíÊܹ¤×÷µÄϲÔᣱÕÁËÒ»»áÑÛ¾¦È»ºóÍ˳öϵͳ¡£
Price Wang said, "Would that all of my programmers were as wise!"
¡°Ê²Ã´Ê±ºòÎҵijÌÐòÔ±²ÅÄܶ¼´ïµ½ÕâÑùµÄ¾³½ç!¡±
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.
Õâ²»ÊDZà³ÌÖ®µÀ¡£
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.
Õâ²ÅÊDZà³ÌÖ®µÀ¡£
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µãµ½ÕýÎçµã¡£¡±£¬ËùÓеijÌÐòÔ±¶¼
ºÜ²»Âú¡£
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?"
Ò»¸öÐÂѧÎÊ´óʦ£º¡°ÔÚ¶«·½£¬ÓÐÒ»¸öÅÓ´óµÄ»ú¹¹£¬ÈËÃdzÆ×÷×ܲ¿¡£ËüÓÉΪÊýÖÚ¶à
µÄ´óСÁìµ¼¡£Ã¿Ìì·¢³ö´óÁ¿µÄ
±¸Íü¼£¬Ã¿¸ö±¸Íü¼¶¼Ëµ£º¡®¸ÉÕâ¸ö£¬¸ÉÄǸö¡¯£¬Ã»ÓÐÒ»¸öÈËÖªµÀËüÊÇʲôÒâ˼¡£
ÿÄêÕâ¸ö»ú¹¹¶¼»áÓиü¶àµÄÈ˼ӽøÀ´¶ø±äµÃÔ½À´Ô½´ó£¬µ«ÊÇȥûÓÐÈËÈ¥×öÊÂÇé¡£
Ôõô»âÑùÆæ¹ÖµÄ¶«Î÷»¹ÄÜ´æÔÚÄØ£¿¡±
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?"
ÓÐÒ»¸ö¹¤×÷ÔÚ΢»úÉϵijÌÐòÔ±¶ÔÇ°À´²Î¹ÛµÄ´óÐÍ»ú³ÌÐòÔ±
˵£º¡°¿´¿´ÎÒÕâÀï°É£¬ÎÒÓÐ×Ô¼ºµÄ²Ù×÷ϵͳºÍÎļþ´æ´¢É豸£¬ÎÒ²»ÐèÒªÓë±ðÈ˹²Ïí
ÈκÎ×ÊÔ´£¬Èí¼þÌõÌõÓÐÀí²¢ÇÒÒ×ÓÚ²Ù×÷¡£ÎªÊ²Ã´Äã²»´ÇÈ¥ÄãµÄ¹¤×÷µ½ÕâÀïÀ´ÄØ£¿¡±
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."
¡°ÏÖÔÚÊÇÄã³öʦµÄʱºòÁË¡£¡±