`
xiaoliu216
  • 浏览: 22768 次
  • 性别: Icon_minigender_1
  • 来自: 广西
最近访客 更多访客>>
社区版块
存档分类
最新评论

《The Tao Of Programming》Book Three - Design

阅读更多
Book Three - Design
第三篇 设计

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.
大师耸了耸肩说:“那这个项目就永远完不成了。”


分享到:
评论

相关推荐

    The Tao Of Programming

    ### 编程之道——《The Tao Of Programming》精读 #### 第一部分:概述与核心理念 **标题**:“The Tao Of Programming”(编程之道) **描述**:“编程之道,绝对经典。” **标签**:“Programming” 从标题和...

    The Tao Of Programming —— 编程之道

    美国是个软件工业和程序设计水平处于世界依靠地位的国家,我们是不是可以从 那里借鉴点什么呢?您将要读到的《编程之道》一书便是出息美国的一位善于进 行哲学性思考、有十多年工作经验的程序设计师--Geoffrey ...

    编程之道(The tao of programming)

    《编程之道》是一本深受程序员喜爱的经典著作,它以寓言的形式揭示了编程的艺术与哲学。这本书通过一系列富有智慧的故事,向我们传达了编程的精髓,帮助开发者在实践中找到解决问题的深层思考方式。...

    The+Tao+of+Microservices-Manning(2017).pdf

    The Tao of Microservices guides you on the path to understanding how to apply microservice architectures to your own real-world projects. This high-level book offers a conceptual view of microservice ...

    the tao of programming

    《编程之道》(The Tao of Programming)是一本以哲学视角探讨计算机编程原理及精神的书籍,它以道家思想为灵感,通过一系列寓言故事和智慧格言来阐述编程的精髓与艺术。本书由Geoffrey James翻译,经多位贡献者编辑...

    The Tao of Microservices

    The Tao of Microservices Authors: Richard Rodger ISBN 10: 1617293148 ISBN 13: 9781617293146 Edition: 1 Released: 2017-12-31 Format: Paperback (328 pages)...http://finelybook.com/the-tao-of-microservices/

    The Tao of Network Security Monitoring Beyond Intrusion Detection

    The Tao of Network Security Monitoring Beyond Intrusion Detection By Richard Bejtlich Pages : 832 英文

    The Tao of Physics - F. Capra.pdf

    物理之道,一本把现代物理和东方神秘学放在一起做科普的小书。此书共分三章,前两章分别介绍现代物理和东方神秘学各大流派,第三章则是对两者的对比讨论。

    tao-ace-rtai-port-0.3-rc1.tar-源码.rar

    【标题】"tao-ace-rtai-port-0.3-rc1.tar-源码.rar" 提供的是一款开源软件的源代码压缩包,它包含的是 Tao ACE RTAI(Real-Time Application Interface)的移植版本0.3的候选发布1(Release Candidate 1)。...

    The Tao of Windows Buffer Overflow

    《Windows缓冲区溢出之道》是一本深入探讨Windows系统中缓冲区溢出漏洞的经典著作。在信息技术领域,安全是至关重要的,而缓冲区溢出作为一类常见的安全问题,经常被黑客利用来攻击系统,获取非法权限。...

    kdd18_slides-yutao-AMiner-Name-Disambiguation

    kdd18_slides-yutao-AMiner-Name-Disambiguation 命名冲突的好slides

    The Tao of Microservices 1Ed 2017 pdf

    Manning 的 The Tao of Microservices,1Ed 2017-12月出版. 英文完美PDF(非转换). 去掉了只读模式, 可以做笔记. 另外重新编排了页码, 跟 pdf 是一一对应, 方便跳转. 注: 不想要这么多分. 我权限低, 是系统自动弄的.....

    The Tao of Windows Buffer Overflow 缓冲区溢出之道

    The Tao of Windows Buffer Overflow 缓冲区溢出之道 中文翻译版

    ACE-5.4+TAO-1.4+CIAO-0.4.part2.rar

    此外,ACE 开发组的许多成员目前正在进行 The ACE ORB(TAO,http://www.cs.wustl.<br>edu/~schmidt/TAO.html)的开发工作。 <br>使用 ACE的好处 诸多使用 ACE 的好处包括: 增强可移植性:在 ACE ...

    CORBA Programming with TAO

    CORBA Programming with TAO,整理自“大卫的思维空间”,内容简洁,快速入门。格式制作为CHM,方便阅读。

    《CORBA Programming with TAO》

    《CORBA Programming with TAO》是一篇专门为CORBA编程初学者准备的文章,它详细介绍了如何使用TAO(The ACE ORB)这一实现CORBA标准的开源ORB(对象请求代理)。TAO是ACE(Adaptive Communication Environment)...

    Tao Adaptive Control design and analysis

    Tao Adaptive Control design and analysis 自适应控制器设计与分析

    ACE-5.4+TAO-1.4+CIAO-0.4.part3.rar

    此外,ACE 开发组的许多成员目前正在进行 The ACE ORB(TAO,http://www.cs.wustl.<br>edu/~schmidt/TAO.html)的开发工作。 <br>使用 ACE的好处 诸多使用 ACE 的好处包括: 增强可移植性:在 ACE ...

    Tao-reviewboard-master.zip

    Eclipse 代码review 插件,下载后 Tao-reviewboard-master\Tao-reviewboard-master\doc文件夹中Tao-ReviewBoard_UseGuide.docx 使用文档 \updatesite\plugins中的jar 放入eclipse plugins中即可

Global site tag (gtag.js) - Google Analytics