<<gile Software Development: Principles, Patterns, and Practices>>
Single Responsibility Principle SRP
Open Closed Principle OCP
Dependency Inversion Principle DIP
书本教给你的只是一些工具,经验或技巧。能否掌握还是得靠不断地Practice and Practice

Meaningful Names

Use Intention-Revealing Names
The name of a variable, function, or class, should answer all the big question. It should tell you why it exists,
what is does, and how it is used. If a name requires a comment, then the name does not reveal its intent.

Use Intention-Revealing Names

Avoid Disinformation

Make Meaningful Distinctions

Use Pronounceable Names

Avoid Encodings

Avoid Mental Mapping

Class Names

Method Names

Dont’ Be Cute

Pick One Word per Concept

Don’t Pun

Use Solution Domain Names

Use Problem Domain Names

Add Meaningful Context

Don’t Add Gratuitous Context



Do one thing

One Level of Abstraction per Function

Switch Statements

Use Descriptive Names

Function Arguments

Have No Side Effects

Command Query Separation

Prefer Exceptions to Returning Error Code

Don’t Repeat Yourself

Structrued Programming




Objects and Data Structrues

Error Handling


Using Third-Party Code