Shared code extracted to avoid duplication, but the duplication was coincidental: same code, different reasons to change.
The shared abstraction becomes worse than what it replaced.
Extract shared function → new requirement needs different behavior → add parameter → …
The abstraction accumulates conditionals serving callers with conflicting needs, each coupled through it.
Transclude of the-wrong-abstraction#^58e0b3
The fix: re-introduce duplication (inline the abstraction), then figure out what’s actually shared.
DRY targets textual similarity, but what matters is whether code changes for the same reasons (cohesion).
Link to original
→ DRY is prone to goodharting: the wrong abstraction
hard balance here, repeat code always still make grug stare and say “mmm” often, but experience show repeat code sometimes often better than complex DRY solution
Link to original
Distinct from premature abstraction: building flexibility you’ll never use.