KISS vs YAGNI
The KISS principle and YAGNI both push you toward less code, but they answer different questions. KISS asks how to build something: pick the simplest design that works. YAGNI asks whether to build it at all: wait until a real need shows up. You can follow one and break the other, so most teams keep both in mind.
KISS Principle
The rule to pick the simplest design that does the job.
KISS stands for keep it simple, stupid, and it means choosing the simplest design that works. Simple code has fewer places for bugs to hide. It is also quicker for others to read and change. Fancy patterns and extra layers should be added only when a real need appears. The phrase is said to come from a US Navy engineer in the 1960s.
You Aren't Gonna Need It (YAGNI)
Do not build a feature until you really need it.
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.
In one line
- KISS Principle
- The rule to pick the simplest design that does the job.
- You Aren't Gonna Need It (YAGNI)
- Do not build a feature until you really need it.