unix設計哲學
說到Unix為我們所帶來的軟件開發的哲學,我必需要說一說。Unix遵循的原則是KISS(Keep it simple, stupid)。在https://en.wikipedia.org/wiki/Unix_philosophy 上有很多的基本上大同小異的Unix哲學,都是很經典的。
Doug McIlroy 是認為UNIX的哲學是這樣的:三條哲學,簡明扼要,就是這三條哲學貫穿著整個Unix世界。尤其是第一條“do one thing and do it well”真是相當精彩!
l Write programs that do one thing and do it well.
l Write programs to work together.
l Write programs to handle text streams, because that is a universal interface.
隻要是Unix的程序員,他們會比別的程序員在任何時候都會不停地強調著這三條哲學。
而《The Art of Unix Programming》總結了下麵這些哲學,都是至理名言啊。
- 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.
- 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 sooner than you think.
X Windows 的設計者 Mike Gancarz 給出了下麵九條哲學思想
- Small is beautiful.
- Make each program do one thing well.
- Build a prototype as soon as possible.
- Choose portability over efficiency.
- Store data in flat text files.
- Use software leverage to your advantage.
- Use shell scripts to increase leverage and portability.
- Avoid captive user interfaces.
- Make every program a filter.
在今天,這種思想依然被傳承著,在影響著世界上各個角落的每一個程序員。
最後更新:2017-04-03 07:57:13
上一篇:
The Animation in android
下一篇:
asp.net 網站發布
GNUradio tools for packet-switched transmission(message source 和message sink)
《正則表達式經典實例(第2版)》——1.2 使用正則表達式進行查找和替換
jQuery中通過$.browser來判斷瀏覽器
【mysql】mysqldump用法
一個女程序員的正能量故事
智慧醫療節約救治時間,降低患者死亡率
HDU 1251
DB賬號防泄密,請立刻為數據庫加把鎖!(附演示視頻)
Tectonic 1.7升級了容器編排平台,提供了新的監控功能並支持微軟Azure
Windows的定時任務(Schedule Task)設置