Imagine you are asked to build:
A simple blogging platform.
Current requirements:
Create Post
Edit Post
Delete Post
View PostA developer starts thinking:
What if someday we support:
- Multiple languages?
- AI Content generation?
- Plugin Marketplace?
- Offline sync?
- Distributed storage?
- Blockchain verification?Months later:
10,000 lines of codehave been written.
The project still doesn't support:
Create Postproperly.
The team spent time building:
Features Nobody Asked ForThis is one of the most common causees of software bloat.
To solve this problem, the Agile community introduced:
YAGNI
Historical background
YAGNI originated in Extreme Programming (commonly called XP)
created by: Kent Beck
The core observation:
Teams were spending enormous effort building:
Potential Featuresinstead of:
Actual FeaturesMost of those potential features:
Were Never UsedThus: YAGNI
Official Definition
Always implement things when you actually need them, never when you just foresee that you may need them.
Simple version:
Don't build for imaginary requirements.The Fundamental Problem
Developers are often afraid of future change.
They think:
Let's nbuild flexibility now.Examples:
Maybe we'll support 50 databases.
Maybe we'll support 20 payment providers.
Maybe we'll support 100 notification channels.Reality:
One database.
One payment provider.
One notification channel.for years.
The extra architecture becomes:
Dead WeightReal-World Analogy
Imagine building a house.
Current family:
2 Adults
1 ChildInstead of building:
3 BedroomsYou build:
25 Bedrooms
3 Swimming Pools
Helicopter Pad
Movie TheaterWhy?
Maybe someday…This is exactly how many software systems are built.
YAGNI says:
Build the third bedroom first.
The Cost of Unused Features
Many engineers underestimate this.
Unused code is not free.
Every feature creates:
Implementation Cost
Testing Cost
Documentation Cost
Maintenance Cost
Bug Cost
Refactoring CostEven if nobody uses it.
Unused code is still:
Code You Must Maintain
Leave a comment
Your email address will not be published. Required fields are marked *
