Linux Training

Linux training for private, public & voluntary sector.

0800 024 8425

City LinUX Training Courses

Section 7.
Philosophy
.


"Write programs that do one thing and do it well. Write programs to work together. Write programs that handle text streams, because that is a universal interface."

Doug McIlroy - The Bell System Technical Journal 1978.

7. The UNIX philosophy.

One of the great strengths of UNIX/Linux is it’s simplicity and its connectivity. By writing small programs that do one thing well and connecting them to other programmes it is possible for us dwarfs to stand on the shoulders of giants. (Bob Young/ Isaac Newton)

Doug McIlroy, as head of the Bell Labs CSRC and contributor to Unix pipes, summarised Unix philosophy as follows:

"This is the Unix philosophy: Write programs that do one thing and do it well. Write programs to work together. Write programs to handle text streams, because that is a universal interface."

7.1. Keep it Simple.

Eric S. Raymond, in "The Art of Unix Programming", summarised the Unix philosophy as the KISS Principle of "Keep it Simple, Stupid.

7.2. Raymond’s design rules:

Rule of Modularity: Write simple parts connected by clean interfaces.

Rule of Clarity: Clarity is better than cleverness.

Rule of Composition: Design programs to be connected to other programs.

Rule of Separation: Separate policy from mechanism; separate interfaces from engines.

Rule of Simplicity: Design for simplicity; add complexity only where you must.

Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.

Rule of Transparency: Design for visibility to make inspection and debugging easier.

Rule of Robustness: Robustness is the child of transparency and simplicity.

Rule of Representation: Fold knowledge into data so program logic can be stupid and robust.[4]

Rule of Least Surprise: In interface design, always do the least surprising thing.

Rule of Silence: When a program has nothing surprising to say, it should say nothing.

Rule of Repair: When you must fail, fail noisily and as soon as possible.

Rule of Economy: Programmer time is expensive; conserve it in preference to machine time.

Rule of Generation: Avoid hand-hacking; write programs to write programs when you can.

Rule of Optimization: Prototype before polishing. Get it working before you optimize it.

Rule of Diversity: Distrust all claims for "one true way".

Rule of Extensibility: Design for the future, because it will be here

Eric S Raymond - The Art of Unix Programming


The layout and associated style sheets for this page are taken from the World Wide Web Consortium and used here under the W3C software licence.