BolEnglishLearn · Play · Win
Login

⛔ Software Design Principles · Core Principles

⛔

YAGNI - You Aren't Gonna Need It

Design PrincipleIntermediateModule 2

Do not build speculative features without a real requirement.

Future-proofing can become expensive over-engineering.

💡 In practice

Do not build support for 20 payment providers when only one is required.

🖼️ CONCEPT PICTURE
A picture to help remember YAGNI - You Aren't Gonna Need It
Do not build support for 20 payment providers when only one is required.

💡 Like buying a giant freezer for food you might cook someday — it just sits there costing you space and money.

💡 Learn🛠️ Apply🎯 Check

💡 Why it matters

Features built "just in case" cost time now and must be maintained forever, even if they are never used. Guesses about the future are often wrong, so you end up reworking the guess anyway. Building only what is needed today keeps the code smaller, cheaper and easier to change when the real need arrives.

🛠️ How to achieve it

1
Build for today's requirement
Write exactly what the current task needs, not what you imagine next year might want.
2
Wait for the real need
Add the general version when a second real case actually shows up, not before.
3
Keep designs changeable
Favor code that is easy to extend later, so delaying the feature costs you little.
4
Question every "might need"
When you hear "we might need", ask for a concrete, current requirement before building it.

⚠️ Signs of trouble

  • •There are config options and hooks that nothing uses.
  • •Abstractions were built for cases that never arrived.
  • •Dead code paths exist "for the future".
  • •People spend time maintaining features no one asked for.
⚠️ Common mistake: Building a flexible framework for imagined future needs that never come. Build for the real requirement in front of you and extend later when a concrete need appears.

🎯 Quick check

Score: 0/3

Three questions to test the idea.

  1. 1. What does YAGNI warn against?

    Answer: Building features before there is a real requirement

    YAGNI says don't build speculative features; wait until a concrete need actually appears.

  2. 2. Only one payment provider is required. What does YAGNI advise?

    Answer: Support just the one, and extend later if needed

    Build for the real requirement today; adding the rest now is cost with no current benefit.

  3. 3. Why are speculative features risky?

    Answer: Guesses about the future are often wrong and must be maintained anyway

    You pay to build and maintain a guess that may never be needed or may need reworking.

🔑 Key terms

Speculative feature
Something built for a future that is only guessed at.
Over-engineering
Adding more generality than the problem needs.
Requirement
A concrete thing the system must actually do now.
Dead code
Code that is never run or used.

✅ Review checklist

📊 Your progress

0%
Mark this topic learned to track it.
Saved in this browser.
🚀 Got it?
Mark it learned and move to the next topic.
Next topic →