Skip to content
BENIBIX Learn

You Aren't Gonna Need It (YAGNI)

Development🧩 Programming ConceptsDevelopment Practices

Also known as YAGNI, You Ain't Gonna Need It, You Aren't Going to Need It

Do not build a feature until you really need it.

Think of it like

Think of it like not buying a pram before you have a baby. Wait until you need it.

Example

Jack wants to make his app support ten languages, though all users speak English. He skips it. A year later still nobody has asked.

Why it matters

Code for needs you only imagine costs time now. It also needs care forever, often for nothing.

Definition

You aren't gonna need it, or YAGNI, is the rule not to build something until you actually need it. Developers often add options or features just in case. Most of those are never used, but they still have to be tested and kept working. YAGNI says build only what today's task asks for. The idea comes from Extreme Programming in the late 1990s.

Common mistake

Using YAGNI as an excuse for messy code. It is about not adding features. It is not about skipping good shape.

Key takeaways

  1. 1
    Build what is asked. Not what might be.
  2. 2
    Unused code costs. Tests and upkeep.
  3. 3
    Add it later. When the need is real.

Compare

Learn it properly