DRY: Don’t repeat yourself.
Interface Segregation Principle: A subclass shouldn’t have to implement an interface that it doesn’t use.
YAGNI: You aren’t Going to Need It. Favor minimal designs as complexity comes back to bite you.
Resource Acquisition is Initialization: Constructor sets up the resource (or throws an exception) and the destructor frees the resource. The opposite of this would be fopen() and close(). It’s better to have a std::ifstream file(”filename.txt”); which automatically closes the file when it goes out of scope. fopen() … close() might have an exception or return between the two and leak the resource.
Stable Dependencies Principle: Something should only depend on things more stable than itself. Don’t build a program upon sandy libraries!
Information Hiding: Only pass along information to a function or another class which is needed for it to do the requested job.
Law of Demeter: Don’t have a parent class reach for things from it’s grand children. Instead ask the children which can then ask it’s children. This allows a child to change it’s implementation without the parent breaking.
Encapsulate What Changes: Lower maintenance cost.
Favor Composition over Inheritance: Easier to compose what a class can do fewer implications. Harder to compose what a class is which has wider implications.
KISS: Keep it simple stupid. Avoid unnecessary complexity.
Favor Immutability: Stability results in less bugs and easier understanding.