Skip to content

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 or 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 user in the way that astonishes him least.

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.

- The Tao of Programming, 4.2

2 Comments

  1. Gerall wrote:

    Thanks for finding this for me, Chris. I’m in the process of working on a new application right now, myself.

    This post (and link) has helped get me back into the right frame of mind.

    Keep hackin’!

    Sunday, January 14, 2007 at 10:46 am | Permalink
  2. James wrote:

    I read this and I heard, “A program should be like the bass player in a band: if he stands out, chances are he’s not playing well”

    Sunday, January 14, 2007 at 4:26 pm | Permalink

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*
Loading Mahalo Top 7...
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States