你对编程的“道”和“术”的理解( 六 )


公子王曰:“吾之程序员皆如此,则其善焉!”
第五章 维护Thus spake the master programmer:"Though a program be but three lines long, someday it will have to be maintained."师曰:“程序虽短,终将修之。”
5.1A 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.2A 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.3A 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\u0026#39;t be so impatient," he said, "I\u0026#39;ll put the financial stuff in eventually."或忙于财务软件。
其操劳数日,师视之,见屏幕编辑器、图形子程序、AI界面,惟不见财务。
师惑之。其怒对曰:“甚矣,汝之无忍。吾将置之于其末。”
5.4Does 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?耕者岂有不事其稼者乎?
师者岂有不问其弟子者乎?
父者岂有不饱其子者乎?
程序员者岂有不修其代码者乎?
第六章 管理Thus spake the master programmer:"Let the programmer be many and the managers few -- then all will be productive."师曰:“增程序员而减御者,高产也。”
6.1When 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.御者多会兮,而人心离;会计短视兮,而预算减;科官骛高兮,而困境增。


推荐阅读