Composition Over Inheritance
Favor object composition over inheritance to achieve flexibility, reduce fragility, and improve code reuse.
Favor object composition over inheritance to achieve flexibility, reduce fragility, and improve code reuse.
Master DRY principle: eliminate knowledge duplication for maintainable code, improved consistency, and reduced bugs.
Identify volatile aspects of your system and hide them behind stable interfaces to reduce coupling and change impact.
Detect and report errors immediately to prevent silent failures, data corruption, and cascading problems.
Build systems where components relate strongly to their purpose while remaining loosely connected to other components.
Prefer immutable data structures to reduce bugs, improve thread safety, and simplify reasoning about code.
Simplicity first: write code that humans understand before optimizing for machines.
Design systems where behavior matches user expectations, minimizing surprise and confusion.
Design systems where different areas address different aspects of functionality, improving modularity and maintainability.
A class should have only one reason to change. Master focused, maintainable design.
Avoid speculative generality: implement only features needed today, not imagined future requirements.