The Tao of Programming |
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.
Thus spake the master programmer:
After three days without programming, life becomes
meaningless.
Thus spake the master programmer:
When a program is being tested, it is too late to
make design changes.
Thus spake the master programmer:
A well-written program is its own heaven; a poorly-written
program is its own hell.
Thus spake the master programmer:
Though a program be but three lines long, someday
it will have to be maintained.
Thus spake the master programmer:
You can demonstrate a program for a corporate executive,
but you can't make him computer literate.
Thus spake the master programmer:
Let the programmers be many and the managers few
-- then all will be productive.
The master replied, "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."
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.
" It will take one year," said the master promptly.
" But we need this system immediately if not sooner! How long will it take if I assign ten programmers to it?"
The master programmer frowned. "In that case, it will take two years."
"And what if I assign a hundred programmers to it?"
The master programmer shrugged. "Then the design will never be completed," he said.
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."
The master replied, "You perceive this immense structure and are disturbed that it has no rational purpose. Can you not take amusement form its endless gyrations? Do you not enjoy the untroubled ease of programming beneath its sheltering branches? Why are you bothered by its uselessness?"
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 end-to-end like a great ocean of machinery. The software is 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.
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.
"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 by 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 well and good, but which is easier to debug?"
The programmer made no reply.
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.
"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?"
The master coughed and shifted his position slightly. "The lesson is over for today," he said.
"Excellent!" the Price exclaimed, "Your technique is flawless!"
"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 saw 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!"
These are great mysteries.
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 at noon and work to the wee hours of the morning.