Every codebase I've worked on has a function that everyone is quietly afraid of. It started small and reasonable, two or three callers, a clear job. Then it grew a boolean parameter. Then another. Then an options object, a couple of early returns keyed on who was calling it, and a comment that says // don't touch unless you know what you're doing. Nobody knows what they're doing. That function is what a good intention looks like three years later.
I want to make a case that cuts against one of the first instincts we train into engineers, that duplication is the enemy. It usually isn't. The wrong abstraction is the enemy, and it's a lot more expensive than the duplication it was meant to remove.
The failure mode is almost never recklessness. It's diligence. You see two pieces of code that look alike, two components, two handlers, two mappers, and you do the responsible thing and pull out the shared part. At that moment