FYI: The Unix philosophy
Lloyd Kvam
python at venix.com
Mon Mar 9 11:02:24 EDT 2009
(Please excuse the top posting.)
Ben, Thanks for posting these texts last month.
I had the need to write some Perl code recently which forced me to pull
out "Learning Perl" from the bookshelf. Larry Wall wrote a very
entertaining forward that takes issue with some of these principles.
http://portal.acm.org/citation.cfm?id=572875
We also had a thread about AWK and Sed:
http://www.mail-archive.com/gnhlug-discuss@mail.gnhlug.org/msg25410.html
I think the need for AWK/Sed crib sheets argues that the tools we've
traditionally used for piping text might benefit from some fresh
insights.
On Mon, 2009-02-09 at 22:00 -0500, Ben Scott wrote:
> "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 (inventor of Unix pipes;
> currently Adjunct Professor at NH's own Dartmouth College)
>
> >From _The UNIX Philosophy_ by Mike Gancarz (a member of original X
> window system team):
> Universal:
> 1. Small is beautiful.
> 2. Make each program do one thing well.
> 3. Build a prototype as soon as possible.
> 4. Choose portability over efficiency.
> 5. Store data in flat text files.
> 6. Use software leverage to your advantage.
> 7. Use shell scripts to increase leverage and portability.
> 8. Avoid captive user interfaces.
> 9. Make every program a filter.
> Lesser:
> 1. Allow the user to tailor the environment.
> 2. Make operating systems small and lightweight.
> 3. Use lowercase and keep it short.
> 4. Save trees.
> 5. Silence is golden.
> 6. Think parallel.
> 7. The sum of the parts is greater than the whole.
> 8. Look for the 90-percent solution.
> 9. Worse is better.
> 10. Think hierarchically.
>
> >From _The Art of Unix Programming_ by Eric Raymond (author of
> fetchmail and _The Cathedral and the Bazaar_):
> 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 with 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.
> 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: Repair what you can — but 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 sooner than you think.
>
> -----
>
> I post this because many have apparently forgotten why Unix-like
> OSes win. Free Software is essential to freedom, but I prefer Free
> Software that wins. These principles are why Unix wins.
>
> Even if Microsoft Windows was GPLed, *nix would still win.
>
> Sources for the above:
> * http://www.faqs.org/docs/artu/ch01s06.html
> * http://en.wikipedia.org/wiki/Unix_philosophy
> * http://www.cs.dartmouth.edu/~doug/
> * http://www.princeton.edu/~hos/frs122/precis/mcilroy.htm
> * http://www.catb.org/~esr/writings/taoup/html/
> * http://www.amazon.com/UNIX-Philosophy-Mike-Gancarz/dp/1555581234
>
> Thank you for your time.
>
> _______________________________________________
> gnhlug-discuss mailing list
> gnhlug-discuss at mail.gnhlug.org
> http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/
--
Lloyd Kvam
Venix Corp
DLSLUG/GNHLUG library
http://dlslug.org/library.html
http://www.librarything.com/catalog/dlslug
http://www.librarything.com/rsshtml/recent/dlslug
http://www.librarything.com/rss/recent/dlslug
More information about the gnhlug-discuss
mailing list