UNIX philosophy ---- from TAOUP Eric S. Raymond
1, Rule of Modularity:Write simple parts connected by clean interfaces.
2, Rule of Clarity:Clarity is better than cleverness.
3, Rule of Composition
esign programs to be connected to other programs.
4, Rule of Separation:Separate policy from mechanism; separate interfaces
from engines.
5, Rule of Simplicity
esign for simlicity; add complexity only where you must.
6, Rule of Parsimony:Write a big program only when it is clear by demonstration
that nothing else will do.
7, Rule of Transparency
esign for visibility to make inspection and debugging
easier.
8, Rule of Robustness:Robustness is the child of transparency and simplicity.
9, Rule of Representation:Fold knowledge into data so program logic can be
stupid and robust.
10,Rule of Least Surprise:In interface design, always do the least surprising
thing.
11,Rule of Silence:When a program has nothing surprising to say, it should
say nothing.
12,Rule of Repair:When you must fail, fail noisily and as soon as possible.
13,Rule of Economy
rogrammer time is expensive; conserve it in preference to
machine time.
14,Rule of Generation:Avoid hand-hacking; write programs to write programs
when you can.
15,Rule of Optimization
rototype before polishing. Get it working before you
optimize it.
16,Rule of Diversity
istrust all claims for "one true way".
17,Rule of Extensibility
esign for the future, because it will be here sooner
than you think.
1 子產品化:将它分為若幹個簡單的部分,通過清晰的界面連接配接起來。
2 簡潔:簡潔,比小聰明來得好
3 組合:可以與其他程式互相連接配接
4 分離:結構上要采取分離的政策;将界面與引擎分開
5 簡單:僅僅在必需的時候才增加程式的複雜性
6 節儉:除非無路可走,才去寫那些大型程式
7 透明:使得檢查和Debug的過程非常容易
8 堅固:透明+簡單的結果
9 外在化:将經驗轉化為資料,進而讓程式的邏輯變得易解和健全
10 最少意外:在界面設計上,讓人感覺意外的地方永遠要控制在最少
11 安靜:當一個程式沒有什麼意外的地方的時候,它就會很安靜
12 可修複:盡力修複–但是你一定會出錯的時候,越早越好
13 經濟:程式設計的時間非常昂貴,把它保留下來給機器
14 可再生:避免手工操作。在可以的時候,寫一個程式,讓它幫你程式設計
15 優化:動手之前先要有原型;先讓它運作起來,再優化
16 多樣性:不要相信衆多要求,用一種真正有效的方法
17 可擴充性:為了将來考慮,因為很快它就不是你想的那樣的了