2.2.3 · D2Design Principles

Visual walkthrough — YAGNI — You Aren't Gonna Need It

2,500 words11 min readBack to topic

Step 1 — Draw the decision as two roads

WHAT. You are standing at a fork. A story just asked for feature X maybe being useful later. You can go Build-Now (write the speculative code today) or Wait (write nothing, revisit if a real ticket arrives).

WHY a fork and not a formula? Because YAGNI is a choice under uncertainty. Before any algebra we must be honest that we do not know the future — so we draw two possible roads, not one. A formula that pretended we knew the future would be lying.

PICTURE. Two roads leave one point. The Build-Now road is orange; the Wait road is blue. We will attach money-costs to each road in the next steps.

Figure — YAGNI — You Aren't Gonna Need It

Step 2 — Put the certain costs on the Build-Now road

WHAT. Walk down the Build-Now road. The instant you take it you spend (you wrote the code). Then, for every day the code exists, you spend the daily rate . If you carry it for days, the daily rate stacks up to a total .

WHY split them, and why count days? Because they have different units. is a one-time lump (dollars). is a rate (dollars per day) — you cannot add a rate to a lump until you multiply it by a number of days . This is the fix for the classic mistake of writing "": that adds dollars to dollars-per-day, which is meaningless. We must first turn the daily trickle into a total lump .

PICTURE. One tall orange bar at day 0 (), then a row of short orange bars marching to the right ( each). The total shaded area of the short bars is .

Figure — YAGNI — You Aren't Gonna Need It


Step 3 — The reward only appears through a coin flip

WHAT. The Build-Now road has an upside, but you don't get it automatically. You get the saving only if the guess was right — probability . With probability the guess was wrong and never arrives.

WHY a probability at all? Because "we might need it later" is literally a claim about an uncertain event. To reason about it we must attach a number between 0 and 1. means "certain to be needed" (rare); means "will never be needed"; real speculation lives near the small end.

PICTURE. The green reward sits behind a gate. A coin flip decides whether the gate opens. The gate opens only a fraction of the time — so on average you collect a shrunken reward , drawn as a green bar scaled down by .

Figure — YAGNI — You Aren't Gonna Need It


Step 4 — Line up reward against cost: the break-even line

WHAT. Now put the average reward (green, from Step 3) next to the certain cost (orange, from Step 2). Building speculatively is only worth it when green beats orange.

WHY compare exactly these two? Because the Wait road pays nothing today. So Build-Now is justified only if its net average payoff is positive — reward minus certain cost above zero.

PICTURE. A see-saw. Green on the left pan, orange on the right. The dashed gray line is break-even: the tipping point where the two are equal.

Figure — YAGNI — You Aren't Gonna Need It

Step 5 — Why the inequality almost always FAILS

WHAT. Plug in what real software actually looks like: is small (requirements drift, you guessed the shape wrong), and the carry total grows with time — the longer you sit on unused code, the bigger it gets.

WHY these values? Because imagined requirements rarely arrive as imagined, so hugs the low end. And carried code is read and maintained for many days, so is large and keeps climbing.

PICTURE. As slides from 1 down toward 0, the green reward bar shrinks. There is a threshold where green drops below orange — the break-even . Everything to the left of (small ) is YAGNI territory: don't build.

Figure — YAGNI — You Aren't Gonna Need It

  • What is doing: it is the minimum success-probability that would justify the bet. Below it, the certain costs swallow the average reward.
  • Because the carry total lives in the numerator, every extra day of carrying the code pushes higher — making the bet harder to win the longer the code sits unused. Time is working against you.

Step 6 — The hidden bonus: waiting makes the future job cheaper (and pins down )

WHAT. Recall : the saving from building now is exactly the later-build cost you avoid. Now the key fact — building later usually costs less than building now: . When you finally build it for a real ticket, you know the true requirement — no wrong guesses, no rework.

WHY does knowing the requirement cut cost? Speculative building pays twice: once to build the guessed version, and again to fix it when reality differs. Waiting skips the wrong first version entirely.

PICTURE. Two orange bars for "build the feature": the speculative one is tall ( = guess + rework); the informed-later one is short (). The gap is pure waste avoided by waiting.

Figure — YAGNI — You Aren't Gonna Need It

Step 7 — The degenerate cases (never leave a gap)

WHAT. Check the corners so no scenario surprises you.

WHY corners matter. A rule you only trust in the middle is a rule you don't understand. YAGNI must survive , , , , and the "needed now" case.

PICTURE. Four mini-panels, one per corner, each showing which road wins.

Figure — YAGNI — You Aren't Gonna Need It
Corner What it means Verdict
Guaranteed never needed Green pan empty → never build. Pure waste.
It's certainly needed Then it's not speculation — it's a present requirement. Build it (this is Example 3: validation, auth).
Code is used or scrapped immediately, no carry Then : even a small reward can justify it. But truly zero-day carry almost never exists.
Code is carried forever (never used, never scrapped) grows without bound → certain cost dominates → always a bad bet. The worst case, and the common one for speculative hooks.

The one-picture summary

Everything above collapses into one graph: the average payoff of Build-Now as rises from 0 to 1, with the break-even threshold marked. Left of (the wide YAGNI zone) → wait. Right of it → build. Two forces push rightward — a bigger carry total (more days ) and a cheaper shrinking — so real speculation lives far to the left, which is why YAGNI almost always says no.

Figure — YAGNI — You Aren't Gonna Need It
Recall Feynman: tell the whole walkthrough to a friend

You're at a fork: build the "might-need-it" thing now, or wait. If you build now you pay a big up-front cost plus a small fee every single day the code just sits there — and you have to count the days: multiply the daily fee by how long you'll carry it before it's used or thrown away. The payoff is a prize you might win, and the prize is just the money you'd save by not building it later — so its real average worth is that later-build cost, shrunk by how rarely you'll actually collect it. Line the shrunken prize up against the up-front cost plus the day-by-day total. Now the punchline: the chance of guessing right is small, the daily fee runs for many days, and the later build is cheaper than building now — so the prize side is small and the cost side is big. The contest is almost always a loss. Don't build it. The only exceptions are the corners — when the thing is certainly needed right now, it's not a guess anymore, it's today's job, and you build it well.


Connections

  • Parent: YAGNI — the note this page derives.
  • Rule of Three — the trigger for the cheaper "build later" of Step 6.
  • KISS — Keep It Simple — governs the "needed now" corner: build it, simply.
  • Premature Optimization — same small- bet, performance flavor.
  • DRY — Don't Repeat Yourself — abstracting on first duplication is a tiny- bet too.
  • Extreme Programming — where the inequality's discipline comes from.
  • Technical Debt — speculative code is pre-paid debt with an empty green pan.
  • Simplicity — the fewer roads you take, the less bill you carry.