UNIX philosophy ---- from TAOUP Eric S. Raymond1, Rule of Modularity:Write simple parts connected by clean interfaces.2, Rule of Clarity:Clarity is better than cleverness.3, Rule of Compositionesign programs to be connected to other programs.4, Rule of Separation:Separate policy from mechanism; separate interfaces from engines.5, Rule of Simplicityesign 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 Transparencyesign 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 Economyrogrammer 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 Optimizationrototype before polishing. Get it working before you optimize it.16,Rule of Diversityistrust all claims for "one true way".17,Rule of Extensibilityesign 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 可扩展性:为了将来考虑,因为很快它就不是你想的那样的了