Coupling, cohesion, information hiding and simplicity: the principles that decide whether a codebase gets easier or harder to change over time.
- Essential and Accidental Complexity
- Separating the difficulty that comes from the problem from the difficulty added while solving it, and technical debt as the accidental complexity that was kept on purpose, with the interest it charges on every later change.
- Coupling and Cohesion
- Keeping related things together and unrelated things apart, so changes stay local.
- Information Hiding and Deep Modules
- Small interfaces over substantial functionality, so callers never depend on internal decisions.
- Naming
- Names that say what something does, which make code checkable by reading and easier for models to use correctly.
- Simplicity and YAGNI
- Building for the requirements you have, and adding generality only when a second real case appears.
- Refactoring Under Tests
- Changing structure in small steps without changing behavior, with tests proving each step.