🔍 The Discovery
This principle emerged during a conversation about CSS spacing issues. What started as a request for "breathing room" evolved into "compact cards," then "minimal padding," then "no bottom boundary." Each iteration, instead of replacing the previous solution, I kept adding new rules on top of old ones.
The result: CSS rules fighting each other, duplicate definitions, and a simple layout problem becoming impossibly complex.
⚔️ Patch vs Refactor
- Add new rules alongside old ones
- Override with !important
- Layer fixes on top of problems
- Accumulate technical debt
- Create conflicting definitions
- Make future changes harder
- Replace old rules with new ones
- Consolidate related definitions
- Clean up as you go
- Maintain consistent architecture
- Single source of truth
- Enable future flexibility
💻 Code Example
The Patching Trap:
The Refactoring Solution:
🌿 Beyond Code: Life Metaphors
🎯 When to Apply This Principle
Refactor when:
- Requirements have fundamentally shifted
- You're adding your third "override" or "exception"
- The solution feels unnecessarily complex
- You're working around your own previous decisions
- Future changes will be harder because of current patches
Patch when:
- It's a genuine edge case or temporary fix
- The underlying architecture is still sound
- You're under extreme time pressure (but plan to refactor later)
- The change is truly additive, not corrective
🌊 The Creative Process Parallel
In creative work, requirements naturally evolve. A client saying "more breathing room" then "but compact" isn't contradictory—it's iteration toward the right solution. The problem isn't the evolution; it's how we handle it.
Whether it's code, design, writing, or thinking—the principle holds: when the foundation shifts, rebuild it rather than propping it up.
🔧 Practical Implementation
Code Refactoring Checklist:
- Before adding a new rule, check if it conflicts with existing ones
- If you're overriding more than one property, consider replacing the entire rule
- Consolidate related properties into single, coherent definitions
- Remove unused or superseded rules completely
- Test that the refactored version achieves the same goals more cleanly
Life Refactoring Signals:
- You're making exceptions to your exceptions
- Simple tasks feel unnecessarily complicated
- You're working around systems you created
- New goals conflict with old structures
- You find yourself saying "it's complicated" a lot