agile3
Engineering Practices

Simple Design

Building only what's needed now, in the clearest way, so the design stays easy to change.

2 min read · Practitioner

In 30 seconds

  • Do the simplest thing that could possibly work.
  • Kent Beck's four rules guide what simple means.
  • Simple isn't easy; it takes discipline and refactoring.

Kent Beck's four rules

  1. Passes all the tests
  2. Reveals intention
  3. No duplication
  4. Fewest elements

In priority order. These come from Extreme Programming.

YAGNI

"You aren't gonna need it": don't build for imagined future needs. Build for today's stories; when tomorrow's need arrives, refactor to support it. This is the agile principle of maximizing the work not done.

Why it matters

Speculative code adds complexity, bugs and maintenance. Simple code is faster to read, test and change, which supports emergent design.

Myth vs reality

Myth · Simple means quick and dirty.
Reality · Simple means clear and minimal, not careless.
Myth · Simple designs can't scale.
Reality · They evolve to scale when needed.
Myth · YAGNI means never planning ahead.
Reality · Plan for costly-to-change decisions; skip speculation.

FAQ

How do I know when it's simple enough?

When removing anything would break a test or hide intent.

Does simple design conflict with architecture?

No; keep architecture light and intentional.

What's the last responsible moment?

Decide as late as you can without the delay causing harm.