Advertisement
h3xx

/usr/share/games/fortunes/tao-of-programming

Jul 27th, 2011
209
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.80 KB | None | 0 0
  1. Thus spake the master programmer:
  2. "When you have learned to snatch the error code from the trap frame, it will
  3. be time for you to leave."
  4. -- The Tao of Programming
  5. %
  6. Something mysterious is formed, born in the silent void. Waiting alone and
  7. unmoving, it is at once still and yet in constant motion. It is the source of
  8. all programs. I do not know its name, so I will call it the Tao of
  9. Programming.
  10.  
  11. If the Tao is great, then the operating system is great. If the operating
  12. system is great, then the compiler is great. If the compiler is great, then
  13. the application is great. The user is pleased and there is harmony in the
  14. world.
  15.  
  16. The Tao of Programming flows far away and returns on the wind of morning.
  17. -- The Tao of Programming
  18. %
  19. The Tao gave birth to machine language. Machine language gave birth to the
  20. assembler.
  21.  
  22. The assembler gave birth to the compiler. Now there are ten thousand
  23. languages.
  24.  
  25. Each language has its purpose, however humble. Each language expresses the Yin
  26. and Yang of software. Each language has its place within the Tao.
  27.  
  28. But do not program in COBOL if you can avoid it.
  29. -- The Tao of Programming
  30. %
  31. In the beginning was the Tao. The Tao gave birth to Space and Time. Therefore
  32. Space and Time are Yin and Yang of programming.
  33.  
  34. Programmers that do not comprehend the Tao are always running out of time and
  35. space for their programs. Programmers that comprehend the Tao always have
  36. enough time and space to accomplish their goals. How could it be otherwise?
  37. -- The Tao of Programming
  38. %
  39. The wise programmer is told about Tao and follows it. The average programmer
  40. is told about Tao and searches for it. The foolish programmer is told about
  41. Tao and laughs at it. If it were not for laughter, there would be no Tao.
  42.  
  43. The highest sounds are hardest to hear. Going forward is a way to retreat.
  44. Great talent shows itself late in life. Even a perfect program still has bugs.
  45. -- The Tao of Programming
  46. %
  47. Thus spake the master programmer:
  48. "After three days without programming, life becomes meaningless."
  49. -- The Tao of Programming
  50. %
  51. The programmers of old were mysterious and profound. We cannot fathom their
  52. thoughts, so all we do is describe their appearance. Aware, like a fox
  53. crossing the water. Alert, like a general on the battlefield. Kind, like a
  54. hostess greeting her guests. Simple, like uncarved blocks of wood. Opaque,
  55. like black pools in darkened caves.
  56.  
  57. Who can tell the secrets of their hearts and minds?
  58.  
  59. The answer exists only in Tao.
  60. -- The Tao of Programming
  61. %
  62. Grand Master Turing once dreamed that he was a machine. When he awoke he
  63. exclaimed:
  64.  
  65. "I don't know whether I am Turing dreaming that I am a machine, or a machine
  66. dreaming that I am Turing!."
  67. -- The Tao of Programming
  68. %
  69. A programmer from a very large computer company went to a software conference
  70. and then returned to report to his manager, saying: "What sort of programmers
  71. work for other companies? They behaved badly and were unconcerned with
  72. appearances. There hair was long and unkempt and their clothes were wrinkled
  73. and old. They crashed our hospitality suite and they made rude noises during
  74. my presentation."
  75.  
  76. The manager said: "I should have never sent you to the conference. Those
  77. programmers live beyond the physical world. They consider life absurd, an
  78. accidental coincidence. They come and go without knowing limitations. Without
  79. a care, they live only for their programs. Why should they bother with social
  80. conventions?
  81.  
  82. "They are alive within the Tao."
  83. -- The Tao of Programming
  84. %
  85. A novice asked the Master: "Here is a programmer that never designs, documents
  86. or tests his programs. Yet all who know him consider him one of the best
  87. programmer in the world. Why is this?"
  88.  
  89. The Master replied: "That programmer has mastered the Tao. He has gone beyond
  90. the need for design; he does not become angry when the system crashes, but
  91. accepts the universe without concern. He has gone beyond the need for
  92. documentation; he no longer cares if anyone else sees his code. He has gone
  93. beyond the need for testing; each of his programs are perfect within
  94. themselves, serene and elegant, their purpose self-evident. Truly, he has
  95. entered the mystery of Tao."
  96. -- The Tao of Programming
  97. %
  98. Thus spake the master programmer:
  99. "When the program is being tested, it is too late to make design changes."
  100. -- The Tao of Programming
  101. %
  102. There once was a man who went to a computer trade show. Each day as he
  103. entered, the man told the guard at the door: "I am a great thief, renowned for
  104. my feats of shoplifting. Be forewarned, for this trade show shall not escape
  105. unplundered."
  106.  
  107. This speech disturbed the guard greatly, because there were millions of
  108. dollars of computer equipment inside, so he watched the man carefully. But the
  109. man merely wandered from booth to booth, humming quietly to himself.
  110.  
  111. When the man left, the guard took him aside and searched his clothes, but
  112. nothing was to be found.
  113.  
  114. On the next day of the trade show, the man returned and chided the guard
  115. saying: "I escaped with a vast booty yesterday, but today will be even
  116. better." So the guard watched him ever more closely, but to no avail.
  117.  
  118. On the final day of the trade show, the guard could restrain his curiosity no
  119. longer. "Sir Thief," he said, "I am so perplexed, I cannot live in peace.
  120. Please enlighten me. What is it that you are stealing?"
  121.  
  122. The man smiled. "I am stealing ideas," he said.
  123. -- The Tao of Programming
  124. %
  125. There once was a master programmer who wrote unstructured programs. A novice
  126. programmer, seeking to imitate him, also began to write unstructured programs.
  127. When the novice asked the master to evaluate his progress, the master
  128. criticized him for writing unstructured programs, saying "What is appropriate
  129. for the master is not appropriate for the novice. You must understand Tao
  130. before transcending structure."
  131. -- The Tao of Programming
  132. %
  133. There was once a programmer who was attached to the court of the warlord of
  134. Wu. The warlord asked the programmer: "Which is easier to design: an
  135. accounting package or an operating system?"
  136.  
  137. "An operating system," replied the programmer. The warlord uttered an
  138. exclamation of disbelief. "Surely an accounting package is trivial next to the
  139. complexity of an operating system," he said.
  140.  
  141. "Not so," said the programmer, "when designing an accounting package, the
  142. programmer operates as a mediator between people having different ideas: how
  143. it must operate, how its reports must appear, and how it must conform to the
  144. tax laws. By contrast, an operating system is not limited by outside
  145. appearances. When designing an operating system, the programmer seeks the
  146. simplest harmony between machine and ideas. This is why an operating system is
  147. easier to design."
  148.  
  149. The warlord of Wu nodded and smiled. "That is all good and well, but which is
  150. easier to debug?"
  151.  
  152. The programmer made no reply.
  153. -- The Tao of Programming
  154. %
  155. A manager went to the master programmer and showed him the requirements
  156. document for a new application. The manager asked the master: "How long will
  157. it take to design this system if I assign five programmers to it?"
  158.  
  159. "It will take one year," said the master promptly.
  160.  
  161. "But we need this system immediately or even sooner! How long will it take if
  162. I assign ten programmers to it?" The master programmer frowned. "In that case,
  163. it will take two years."
  164.  
  165. "And what if I assign a hundred programmers to it?"
  166.  
  167. The master programmer shrugged. "Then the design will never be completed," he
  168. said.
  169. -- The Tao of Programming
  170. %
  171. Thus spake the master programmer:
  172. "A well-written program is its own heaven; a poorly-written program is its own
  173. hell."
  174. -- The Tao of Programming
  175. %
  176. A program should be light and agile, its subroutines connected like a string
  177. of pearls. The spirit and intent of the program should be retained throughout.
  178. There should be neither too little nor too much, neither needless loops nor
  179. useless variables, neither lack of structure nor overwhelming rigidity.
  180.  
  181. A program should follow the 'Law of Least Astonishment'. What is this law? It
  182. is simply that the program should always respond to the user in the way that
  183. astonishes him least.
  184.  
  185. A program, no matter how complex, should act as a single unit. The program
  186. should be directed by the logic within rather than by outward appearances.
  187.  
  188. If the program fails in these requirements, it will be in a state of disorder
  189. and confusion. The only way to correct this is to rewrite the program.
  190. -- The Tao of Programming
  191. %
  192. A novice asked the master: "I have a program that sometime runs and sometimes
  193. aborts. I have followed the rules of programming, yet I am totally baffled.
  194. What is the reason for this?"
  195.  
  196. The master replied: "You are confused because you do not understand Tao. Only
  197. a fool expects rational behavior from his fellow humans. Why do you expect it
  198. from a machine that humans have constructed?
  199.  
  200. "Computers simulate determinism; only Tao is prefect.
  201.  
  202. "The rules of programming are transitory; only Tao is eternal.
  203.  
  204. "Therefore you must contemplate Tao before you receive enlightenment."
  205.  
  206. "But how will I know when I have received enlightenment?" asked the novice.
  207.  
  208. "Your program will then run correctly," replied the master.
  209. -- The Tao of Programming
  210. %
  211. A master was explaining the nature of Tao of to one of his novices, "The Tao
  212. is embodied in all software -- regardless of how insignificant," said the
  213. master.
  214.  
  215. "Is the Tao in a hand-held calculator?" asked the novice.
  216.  
  217. "It is," came the reply.
  218.  
  219. "Is the Tao in a video game?" continued the novice.
  220.  
  221. "It is even in a video game," said the master.
  222.  
  223. "And is the Tao in the DOS for a personal computer?"
  224.  
  225. The master coughed and shifted his position slightly. "The lesson is over for
  226. today," he said.
  227. -- The Tao of Programming
  228. %
  229. Prince Wang's programmer was coding software. His fingers danced upon the
  230. keyboard. The program compiled without an error message, and the program ran
  231. like a gentle wind.
  232.  
  233. "Excellent!" the Prince exclaimed, "Your technique is faultless!"
  234.  
  235. "Technique?" said the programmer turning from his terminal, "What I follow is
  236. Tao -- beyond all techniques! When I first began to program I would see before
  237. me the whole problem in one mass. After three years I no longer saw this mass.
  238. Instead, I used subroutines. But now I see nothing. My whole being exists in a
  239. formless void. My senses are idle. My spirit, free to work without plan,
  240. follows its own instinct. In short, my program writes itself. True, sometimes
  241. there are difficult problems. I see them coming, I slow down, I watch
  242. silently. Then I change a single line of code and the difficulties vanish like
  243. puffs of idle smoke. I then compile the program. I sit still and let the joy
  244. of the work fill my being. I close my eyes for a moment and then log off."
  245.  
  246. Prince Wang said, "Would that all of my programmers were as wise!"
  247. -- The Tao of Programming
  248. %
  249. Thus spake the master programmer:
  250. "Though a program be but three lines long, someday it will have to be
  251. maintained."
  252. -- The Tao of Programming
  253. %
  254. A well-used door needs no oil on its hinges.
  255. A swift-flowing stream does not grow stagnant.
  256. Neither sound nor thoughts can travel through a vacuum.
  257. Software rots if not used.
  258. These are great mysteries.
  259. -- The Tao of Programming
  260. %
  261. A manager asked a programmer how long it would take him to finish the program
  262. on which he was working. "I will be finished tomorrow," the programmer
  263. promptly replied.
  264.  
  265. "I think you are being unrealistic," said the manager, "Truthfully, how long
  266. will it take?"
  267.  
  268. The programmer thought for a moment. "I have some features that I wish to add.
  269. This will take at least two weeks," he finally said.
  270.  
  271. "Even that is too much to expect," insisted the manager, "I will be satisfied
  272. if you simply tell me when the program is complete." The programmer agreed to
  273. this.
  274.  
  275. Several years later, the manager retired. On the way to his retirement lunch,
  276. he discovered the programmer asleep at his terminal. He had been programming
  277. all night.
  278. -- The Tao of Programming
  279. %
  280. A novice programmer was once assigned to code a simple financial package.
  281.  
  282. The novice worked furiously for many days, but when his master reviewed his
  283. program, he discovered that it contained a screen editor, a set of generalized
  284. graphics routines, an artificial intelligence interface, but not the slightest
  285. mention of anything financial.
  286.  
  287. When the master asked about this, the novice became indignant.
  288.  
  289. "Don't be so impatient," he said, "I'll put in the financial stuff eventually."
  290. -- The Tao of Programming
  291. %
  292. Does a good farmer neglect a crop he has planted?
  293. Does a teacher overlook even the most humble student?
  294. Does a father allow a single child to starve?
  295. Does a programmer refuse to maintain his code?
  296. -- The Tao of Programming
  297. %
  298. Thus spake the master programmer:
  299. "Let the programmer be many and the managers few -- then all will be
  300. productive."
  301. -- The Tao of Programming
  302. %
  303. When managers hold endless meetings, the programmers write games. When
  304. accountants talk of quarterly profits, the development budget is about to be
  305. cut. When senior scientists talk blue sky, the clouds are about to roll in.
  306.  
  307. Truly, this is not the Tao of Programming.
  308.  
  309. When managers make commitments, game programs are ignored. When accountants
  310. make long-range plans, harmony and order are about to be restored. When senior
  311. scientists address the problems at hand, the problems will soon be solved.
  312.  
  313. Truly, this is the Tao of Programming.
  314. -- The Tao of Programming
  315. %
  316. Why are programmers non-productive?
  317. Because their time is wasted in meetings.
  318. Why are programmers rebellious?
  319. Because the management interferes too much.
  320. Why are the programmers resigning one by one?
  321. Because they are burnt out.
  322. Having worked for poor management, they no longer value their jobs.
  323. -- The Tao of Programming
  324. %
  325. A manager was about to be fired, but a programmer who worked for him invented
  326. a new program that became popular and sold well. As a result, the manager
  327. retained his job.
  328.  
  329. The manager tries to give the programmer a bonus, but the programmer refused
  330. it, saying, "I wrote the program because I thought it was an interesting
  331. concept, and thus I expect no reward."
  332.  
  333. The manager upon hearing this remarked, "This programmer, though he holds a
  334. position of small esteem, understands well the proper duty of an employee.
  335. Let's promote him to the exalted position of management consultant!"
  336.  
  337. But when told this, the programmer once more refused, saying, "I exist so that
  338. I can program. If I were promoted, I would do nothing but waste everyone's
  339. time. Can I go now? I have a program that I'm working on."
  340. -- The Tao of Programming
  341. %
  342. A manager went to his programmers and told them: "As regards to your work
  343. hours: you are going to have to come in at nine in the morning and leave at
  344. five in the afternoon." At this, all of them became angry and several resigned
  345. on the spot.
  346.  
  347. So the manager said: "All right, in that case you may set your own working
  348. hours, as long as you finish your projects on schedule."
  349.  
  350. The programmers, now satisfied, began to come in at noon and work to the wee
  351. hours of the morning.
  352. -- The Tao of Programming
  353. %
  354. Thus spake the master programmer:
  355. "You can demonstrate a program for a corporate executive, but you can't make
  356. him computer literate."
  357. -- The Tao of Programming
  358. %
  359. A novice asked the master: "In the east there is a great tree-structure that
  360. men call 'Corporate Headquarters'. It is bloated out of shape with vice
  361. presidents and accountants. It issues a multitude of memos, each saying 'Go,
  362. Hence!' or 'Go, Hither!' and nobody knows what is meant. Every year new names
  363. are put onto the branches, but all to no avail. How can such an unnatural
  364. entity exist?"
  365.  
  366. The master replies: "You perceive this immense structure and are disturbed
  367. that it has no rational purpose. Can you not take amusement from its endless
  368. gyrations? Do you not enjoy the untroubled ease of programming beneath its
  369. sheltering branches? Why are you bothered by its uselessness?"
  370. -- The Tao of Programming
  371. %
  372. In the east there is a shark which is larger than all other fish. It changes
  373. into a bird whose wings are like clouds filling the sky. When this bird moves
  374. across the land, it brings a message from Corporate Headquarters. This message
  375. it drops into the midst of the programmers, like a seagull making its mark
  376. upon the beach. Then the bird mounts on the wind and, with the blue sky at its
  377. back, returns home.
  378.  
  379. The novice programmer stares in wonder at the bird, for he understands it not.
  380. The average programmer dreads the coming of the bird, for he fears its
  381. message. The master programmer continues to work at his terminal, for he does
  382. not know that the bird has come and gone.
  383. -- The Tao of Programming
  384. %
  385. The Magician of the Ivory Tower brought his latest invention for the master
  386. programmer to examine. The magician wheeled a large black box into the
  387. master's office while the master waited in silence.
  388.  
  389. "This is an integrated, distributed, general-purpose workstation," began the
  390. magician, "ergonomically designed with a proprietary operating system, sixth
  391. generation languages, and multiple state of the art user interfaces. It took
  392. my assistants several hundred man years to construct. Is it not amazing."
  393.  
  394. The master raised his eyebrows slightly. "It is indeed amazing," he said.
  395.  
  396. "Corporate Headquarters has commanded," continued the magician, "that everyone
  397. use this workstation as a platform for new programs. Do you agree to this?"
  398.  
  399. "Certainly," replied the master, "I will have it transported to data center
  400. immediately!" And the magician returned to tower, well pleased.
  401.  
  402. Several days later, a novice wandered into the office of master programmer and
  403. said, "I cannot find the listing for new program. Do you know where it might
  404. be?"
  405.  
  406. "Yes," replied the master, "the listings are stacked on platform in the data
  407. center."
  408. -- The Tao of Programming
  409. %
  410. The master programmer moves from program to program without fear. No change in
  411. management can harm him. He will not be fired, even if the project is
  412. cancelled. Why is this? He is filled with Tao.
  413. -- The Tao of Programming
  414. %
  415. Thus spake the master programmer:
  416. "Without the wind, the grass does not move. Without software, hardware is
  417. useless."
  418. -- The Tao of Programming
  419. %
  420. A novice asked the master: "I perceive that one computer company is much
  421. larger than all others. It towers above its competition like a giant among
  422. dwarfs. Any one of its divisions could comprise an entire business. Why is
  423. this so?"
  424.  
  425. The master replied, "Why do you ask such foolish questions? That company is
  426. large because it is large. If it only made hardware, nobody would buy it. If
  427. it only made software, nobody would use it. If it only maintained systems,
  428. people would treat it like a servant. But because it combines all of these
  429. things, people think it one of the gods! By not seeking to strive, it conquers
  430. without effort."
  431. -- The Tao of Programming
  432. %
  433. A master programmer passed a novice programmer one day. The master noted the
  434. novice's preoccupation with a hand-held computer game.
  435.  
  436. "Excuse me", he said, "may I examine it?" The novice bolted to attention and
  437. handed the device to the master.
  438.  
  439. "I see that the device claims to have three levels of play: Easy, Medium and
  440. Hard", said the master. "Yet every such device has another level of play,
  441. where the device seeks not to conquer the human, nor to be conquered by the
  442. human."
  443.  
  444. "Pray, great master", implored the novice, "how does one find this mysterious
  445. settings?"
  446.  
  447. The master dropped the device to the ground and crushed it under foot. And
  448. suddenly the novice was enlightened.
  449. -- The Tao of Programming
  450. %
  451. There was once a programmer who worked upon microprocessors. "Look at how well
  452. off I am here," he said to a mainframe programmer who came to visit, "I have
  453. my own operating system and file storage device. I do not have to share my
  454. resources with anyone. The software is self-consistent and easy-to-use. Why do
  455. you not quit your present job and join me here?"
  456.  
  457. The mainframe programmer then began to describe his system to his friend,
  458. saying "The mainframe sits like an ancient sage meditating in the midst of the
  459. data center. Its disk drives lie end-to-end like a great ocean of machinery.
  460. The software is as multifaceted as a diamond, and as convoluted as a primeval
  461. jungle. The programs, each unique, move through the system like a
  462. swift-flowing river. That is why I am happy where I am."
  463.  
  464. The microcomputer programmer, upon hearing this, fell silent. But the two
  465. programmers remained friends until the end of their days.
  466. -- The Tao of Programming
  467. %
  468. Hardware met Software on the road to Changtse. Software said: "You are Yin and
  469. I am Yang. If we travel together we will become famous and earn vast sums of
  470. money." And so the set forth together, thinking to conquer the world.
  471.  
  472. Presently they met Firmware, who was dressed in tattered rags and hobbled
  473. along propped on a thorny stick. Firmware said to them: "The Tao lies beyond
  474. Yin and Yang. It is silent and still as a pool of water. It does not seek
  475. fame, therefore nobody knows its presence. It does not seek fortune, for it is
  476. complete within itself. It exists beyond space and time."
  477.  
  478. Software and Hardware, ashamed, returned to their homes.
  479. -- The Tao of Programming
  480. %
  481. Thus spake the master programmer:
  482. "Time for you to leave."
  483. -- The Tao of Programming
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement