Re:Code duplication is far cheaper than the wrong abstraction
by ytoawwhra92 on Sunday June 21, 2026 @08:09PM
(#48623940)
For pure logic I find refactoring to enable divergence much easier than implementing convergence.
Re:Code duplication is far cheaper than the wrong abstraction
by usrusr on Monday June 22, 2026 @01:48AM
(#48626213)
Not only easier finding call sites than finding copies, also more intuitive to start looking. "Which callers will be affected by the change?" is the most natural question to ask. "Which places should have this same change applied?", not so much.
Re:Code duplication is far cheaper than the wrong abstraction
by Maxion on Monday June 22, 2026 @02:14AM
(#48626394)
A lot of the time in my experience this comes down to coders thinking the logic is the same and abstracting something to a central source, when from a business perspective the rules are similar but actually different.
So many times I've had to untangle these types of abstractions when business asks for changes to case X but not Case Y. OR worse, business asks for changes to case X, but it also affects Case Y due to abstractions. Business see X/Y as different things so did not even think to mention that the new suggested behavior is to only affect case X, but to coders they're the same.
But, again, the point is that you don't know yet whether you have a single source of truth or not. It's a question of the relative badness of duplication vs premature abstraction in cases where the code may diverge or converge in the future. There is no generic answer. But as a heuristic, based on my personal experience, I have always found premature abstractions to be more painful to work with. Even more so when someone else has authored them.