principleModeratepending
Principle: You Aren't Gonna Need It (YAGNI)
Viewed 0 times
YAGNIsimplicityoverengineeringprematurecomplexity
Problem
Developers add features, abstractions, or configuration options for hypothetical future requirements that never materialize, increasing complexity and maintenance burden.
Solution
Only build what you need right now:
Bad: config.get('MAX_RETRIES', 3) when it's always 3
Good: MAX_RETRIES = 3 # Change when needed
Bad: interface DatabaseAdapter -> PostgresAdapter (only one impl)
Good: PostgresDatabase (extract interface when second impl needed)
Bad: onBeforeProcess, onAfterProcess, onError hooks everywhere
Good: Simple function that does the thing
Bad: version: 1, _reserved: null, metadata: {}
Good: Just the fields you need today
Bad: Caching layer added 'in case it's slow'
Good: Measure first, optimize the actual bottleneck
Exception: Security and data integrity ARE worth building proactively.
You do need input validation, proper auth, and data backups from day one.
- Don't add configuration for things that have one value
Bad: config.get('MAX_RETRIES', 3) when it's always 3
Good: MAX_RETRIES = 3 # Change when needed
- Don't build abstractions for one implementation
Bad: interface DatabaseAdapter -> PostgresAdapter (only one impl)
Good: PostgresDatabase (extract interface when second impl needed)
- Don't add hooks/plugins/events for extensibility nobody asked for
Bad: onBeforeProcess, onAfterProcess, onError hooks everywhere
Good: Simple function that does the thing
- Don't future-proof APIs
Bad: version: 1, _reserved: null, metadata: {}
Good: Just the fields you need today
- Don't optimize before measuring
Bad: Caching layer added 'in case it's slow'
Good: Measure first, optimize the actual bottleneck
Exception: Security and data integrity ARE worth building proactively.
You do need input validation, proper auth, and data backups from day one.
Why
Every feature you build has ongoing maintenance cost. Features built for hypothetical needs are pure cost with no realized benefit.
Revisions (0)
No revisions yet.