What does YAGNI ('You Aren't Gonna Need It') advise?
Options
- Write every feature that you might need in the future
- Don't build a feature until it is actually needed (Correct option)
- Never write tests for code that is simple enough
- Always apply a design pattern to the code you write
Answer
Don't build functionality until it is actually needed
Why
Code built for imagined future needs costs time now, adds complexity, and is often wrong when the future arrives.
YAGNI says: build what the current requirement needs, keep it simple (KISS), and extend it when a real need appears.
Remember
Build for today's need; keep it simple.