Back to Catalog
Dry Yagni
principles
Keep It Simple, Stupid (KISS)
Most systems work best if they are kept simple rather than made complicated.
Intent & Description
'
π― Intent
Favor simplicity in design. Avoid unnecessary complexity in code, architecture, and solutions.
π Context
Developers often over-engineer solutions with complex abstractions, deep inheritance hierarchies, or clever tricks. This makes code harder to understand, maintain, debug, and extend. Simple solutions are almost always better.
π‘ Solution
Choose the simplest approach that solves the problem. Prefer clarity over cleverness. Use straightforward algorithms. Write readable code. Avoid premature optimization. Refactor complex code into simpler components.'
Real-world Use Case
Use when designing solutions, writing code, or choosing between multiple approaches. Always prefer the simpler option unless there is a compelling reason for complexity.
π TL;DR
Keep it simple. Prefer clarity over cleverness, straightforward over sophisticated. Simplicity is the ultimate form of elegance.
Advantages
- Easier to understand and maintain
- Fewer bugs from complexity
- Faster onboarding for new developers
- Simpler to test and debug
Disadvantages
- Simple solutions may not scale
- May need refactoring as requirements grow
- Balance needed with performance requirements
Implementation Example
// Before: Over-engineered KISS violation
class AbstractDataProcessorFactory {
createProcessor(type) {
const registry = new Map();
registry.set('csv', () => new CSVProcessor(
new ValidationPipeline(
new SchemaValidator(),
new TypeCoercer()
)
));
return registry.get(type)();
}
}
// After: KISS applied
function processCSV(data) {
return data.split('\n').map(line => line.split(','));
}
// Simple, readable, does exactly what's needed