Single Responsibility Principle (SRP) – 職責單一原則:一個類,只作一件事,並把這件事作好web
Open/Closed Principle (OCP) – 開閉原則:模塊對擴展是開放的,而對修改是封閉的shell
Liskov substitution principle (LSP) – 里氏替換原則:子類能替換基類ui
Interface Segregation Principle (ISP) – 接口隔離原則:功能實如今接口,不一樣功能不一樣接口彼此隔離spa
Dependency Inversion Principle (DIP) – 依賴倒置原則:高層模塊不該該依賴於低層模塊的實現,而是依賴於高層抽象。prototype
UNIX的哲學:debug
Write programs that do one thing and do it well.設計
Write programs to work together.orm
Write programs to handle text streams, because that is a universal interface.對象
《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 Window的哲學:
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.