Who asked for this setting? YAGNI, “You Aren’t Gonna Need It”, is the principle behind every option you deleted because nobody ever used it.
Where YAGNI comes from
YAGNI comes from Extreme Programming. Ron Jeffries, one of its founders: “Always implement things when you actually need them, never when you just foresee that you need them.”
Every option has a cost
A feature built “just in case” is not free. Martin Fowler describes the costs of a presumptive feature: the cost of building it, the delay to the features you actually need, the cost of carrying it in the codebase, and the cost of repairing it when it turns out wrong.
In a WordPress plugin, every setting adds more:
- build: the field, sanitizing, saving, the code path that reads it;
- test: every combination of options;
- docs: explaining what it does;
- support: questions from users who changed it.
The problem: building for a future that never comes
Legacy support for a PHP version you no longer run, a multi-provider API for one provider, export formats nobody requested. AI makes this easy: it will happily add “extensible” options to anything.
How to apply YAGNI
- Build for the requirement you have today.
- Make the code easy to change instead of trying to predict the change.
- Delete options nobody uses. Fewer settings is a feature.
What did you build that nobody used?
FAQ
“You Aren’t Gonna Need It”. It is a principle from Extreme Programming, associated with Ron Jeffries.
No. Plan and design for known requirements. YAGNI only says not to implement features for needs you merely foresee.
Building it, delaying real features, carrying it through every change and test, and fixing it later. In plugins, add documentation and user support.
Sometimes. SOLID prepares code for change; YAGNI warns against preparing too early. Apply SOLID where the code is actually changing.
Ship the options users need now. Each extra setting is one more thing to sanitize, test, document and support.
Go deeper
- Essential Principles: 4wp.dev/essential-principles
- Coding Principles Every WordPress Developer Should Know: read the article