Thoughts on the Tao of Programming
Tuesday, July 31st, 2007I recently came across The Tao of Programming, while humorous it also features some ideas which I believe programmers should listen to and implement into the way they think.
The page is split into several sections ranging from design, to code and even onto management and corporate thinking. It is well worth a full read. I have compiled a few notes on the subject, mainly on how I think key sections provide a great insight into the programming mindset.
On Design, Code and Management
Thus spake the master programmer:
“A well-written program is its own heaven; a poorly-written program is its own hell.”
I think this one is self explanatory. The better you write your code, the easier it is to add to and modify.
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?”
“It will take one year,” said the master promptly.
“But we need this system immediately or even 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
Now this is very true, the more people you assign to a project the longer it takes. This is because people debate and change their minds and then you end up getting no where. It is far better to have small team and to assign each member their own section of the system to design/code. Set up a programming standard that everyone can follow and you end up with maintainable code that works and of course accountability, if a section of the system doesn’t work it is clear which programmer worked on it.
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.’
This confused me at first but as I read the rest of the page all became clear, the message here is not that the master writes unstructured programs, but the that the master understands the code to the extent where structure doesn’t matter, I’m sure many of you have your own coding styles and idiosyncrasies that make it difficult for others to understand your programming logic. The novice however must obey all the rules before transcending them.
A manager 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.
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.
I think this is a perfect way of describing the mind of many programmers. I know for me it is perfectly true, any software I create, I cherish, and it isn’t work when I work on it. And I am sure for many of you that your programs would be labours of love. In that sense working on something for more than 12 hours a day is nothing extreme. This section also gives a great sight into the anarchism that lurks in the mind of many programmers, most don’t like corporate structure and hate the 9-5 view of working life. By allow the programmers to be flexable with their time it gives them more freedom and thus they are better able to master the tao.
And I shall leave you with this last one:
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 Tao.”
