# Keep It Simple, Stupid (KISS)

> Most systems work best if they are kept simple rather than made complicated.

- **Category**: Dry Yagni
- **Subcategory**: principles
- **Canonical URL**: https://designpattern.fyi/dry_yagni/kiss/

---

## 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.'



## Use Cases
Use when designing solutions, writing code, or choosing between multiple approaches. Always prefer the simpler option unless there is a compelling reason for complexity.



## Implementation Example

```javascript
// 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
```



## Trade-offs


### Advantages

- Easier to understand and maintain

- Fewer bugs from complexity

- Faster onboarding for new developers

- Simpler to test and debug




### Considerations & Drawbacks

- Simple solutions may not scale

- May need refactoring as requirements grow

- Balance needed with performance requirements







