You never are going to need it

By Daniel Samson · 2024-12-27

YAGNI — You Aren't Gonna Need It — is the most ignored good advice in software. We keep building for a future that never shows up, and paying for it in the present.

The speculative generality trap

It always sounds responsible. "Let's make this configurable in case we need to swap it later." "Let's add a plugin system so we can extend it." "Let's abstract this behind an interface in case there's a second implementation." You're not solving today's problem; you're insuring against an imagined version of tomorrow's.

The cost of "just in case"

Every premature abstraction is code someone has to read, understand, maintain, and — most painfully — work around when the real requirement finally arrives and doesn't fit the shape you guessed. Flexibility isn't free. It's paid for in indirection, in layers, in the extra hop every new developer has to make to understand what's actually going on.

You guess wrong anyway

Here's the kicker: the future requirement is almost never the one you built for. So you pay twice — once to build the speculative machinery, and again to tear it out or bend it when reality turns up wearing a different outfit. The interface you designed for "any payment provider" fits every provider except the one you actually integrate.

Build for today, change it tomorrow

Simple, direct, slightly repetitive code is far easier to change than a clever abstraction pointed in the wrong direction. YAGNI isn't laziness or shortsightedness — it's deferring the decision until you have the information to make it well. Write the thing the requirement in front of you needs. When the second case actually shows up, you'll refactor with real knowledge instead of a guess. You'll be amazed how often the second case never comes at all.