Simplicity Principle: Through the Prism
··1 min
Clarity #
The ability to hold the model or behavior of a module in your mind - being able to reason about about it without having to rely on detailed instructions.
A good indicator: can you explain it to a layperson?
This can be achieved through good abstractions:
- Few elements (less than 7, ideally less than 5), observing Miller’s Law or the rule of 3
- Describe behaviors and intentions.
- Be mindful of leaky abstractions.
Modularity #
A system is created a composition of modules, that are as independent as self contained as they can be.
A good indicator: how easy is it to remove the feature completely from the system? How many places do you need to change to remove it?
Parsimony #
Focus on what is relevant:
- Be intentional.
- Avoid superfluous or assumed functions.
- Provide guarantees over assertion.
- Remove that which is no longer relevant.
To paraphrase Albert Einstein, a parsimonious system is “As simple as it can be, but not simpler than that”.
Code is a liability - don’t take on more than you need to carry.
Keep it simple (but not simplistic).