每個程序員都受益于了解編程原則和設(shè)計模式。
內(nèi)容【Contents】
通用【Generic】
- KISS原則【KISS】
- 避免創(chuàng)建你不要的代碼【YAGNI】
- 盡可能做可運行的最簡單的事【Do The Simplest Thing That Could Possibly Work】
- 關(guān)注點分離原則【Separation of Concerns】
- 避免重復(fù)原則【Keep things DRY】
- 代碼可維護原則【Code For The Maintainer】
- 避免過早優(yōu)化【Avoid Premature Optimization】
- 童子軍規(guī)則【Boy-Scout Rule】
模塊間/類【Inter-Module/Class】
- 低耦合原則【Minimise Coupling】
- 迪米特法則【Law of Demeter】
- 組合重于繼承【Composition Over Inheritance】
- 正交性【Orthogonality】
- 健壯性法則【Robustness Principle】
- 控制反轉(zhuǎn)【Inversion of Control】
模塊/類【Module/Class】
- 高內(nèi)聚原則【Maximise Cohesion】
- 里氏替換原則【Liskov Substitution Principle】
- 開閉原則【Open/Closed Principle】
- 單一職責原則【Single Responsibility Principle】
- 隱藏實現(xiàn)細節(jié)【Hide Implementation Details】
- 科里定律【Curly's Law】
- 封裝變更【Encapsulate What Changes】
- 接口分離原則【Interface Segregation Principle】
- 命令-查詢分離原則【Command Query Separation】
- 五大原則【SOLID】
Test
五大原則【FIRST principles of testing】
-
3A原則【Arrange, Act, Assert】
持續(xù)更新中