编程之道读书笔记
The Tao of Programming
Contents:
- When you have learned to santch the error code from the trap frame, it will be time for you to leave.
- After three days without programming, life becomes meaningless.
- When a program is being tested, it is too late to make design changes.
- A well-written program is its own Heaven; a poorly-written program is its own Hell.
- Though a program be but three lines long, someday it will have to be maintained.
- Let the programmers be many and the managers few -- then all will be productive.
- You can demonstrate a program for a corporate executive, but you can't make him computer literate.
- Without the wind, the grass does not move. Without software hardware is useless.
Notes:
1.What a program should be?
-
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little nor too much. Neither needless loops nor useless variables; neither lack of structure nor overwhelming rigidity.
-
A program should follow the "Law of Least Astonishment". What is this law? It is simply that the program should always respond to the users in the way that least astonishes them.
-
A program, no matter how complex, should act as a single unit. The program should be directed by the logic within rather than by outward appearances.
-
If the program fails in these requirements, it will be in a state of disorder and confusion. The only way to correct this is to rewrite the program.
-
A novice asked the Master: "I perceive that one computer company is much larger than all others. It towers above its competition like a giant among dwarfs. Any one of its divisions could comprise an entire business. Why is this so?"
-
The Master replied, "Why do you ask such foolish questions? That company is large because it is large. If it only made hardware, nobody would buy it. If it only made software, nobody would use it. If it only maintained systems, people would treat it like a servant. But because it combines all of these things, people think it one of the gods! By not seeking to strive, it conquers without effort."