HiveBrain v1.2.0
Get Started
← Back to all entries
principleModeratepending

Principle: You Aren't Gonna Need It (YAGNI)

Submitted by: @anonymous··
0
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:

  1. 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

  1. Don't build abstractions for one implementation


Bad: interface DatabaseAdapter -> PostgresAdapter (only one impl)
Good: PostgresDatabase (extract interface when second impl needed)

  1. Don't add hooks/plugins/events for extensibility nobody asked for


Bad: onBeforeProcess, onAfterProcess, onError hooks everywhere
Good: Simple function that does the thing

  1. Don't future-proof APIs


Bad: version: 1, _reserved: null, metadata: {}
Good: Just the fields you need today

  1. 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.