Four Rules of Simple Design
Kent Beck formulated four rules of simple design while developing Extreme Programming in the late 1990s. A design is simple, in priority order, when it:
- Passes the tests — the software works as intended. Testing is a first-class activity, not an afterthought.
- Reveals intention — the code is easy to understand. Readers can grasp the purpose behind each decision.
- No duplication — every piece of knowledge has a single, unambiguous representation.
- Fewest elements — minimize the number of classes, methods, and moving parts. Remove anything that doesn’t serve the first three rules.
The order matters: passing tests comes first, then clarity, then removing duplication, and finally minimizing structure. Each rule only applies after the ones above it are satisfied.
