3 ms·
It's hard because you often don't know what you don't need before you don't need it. Duplication for < n is good in principle until you realize some coworker d
by preommr 8y ago
It's hard because you often don't know what you don't need before you don't need it.
Duplication for < n is good in principle until you realize some coworker decided to make their own system or went way past n with end result being it'll take more effort to refactor than to have initially designed something robust.
- gmueckl 8y agoIt really depends on how complex the thing is that you have n copies of in your codebase. Also, is it a concrete algorithm? Is it a pattern? A concrete algorithm can usually be factored out more easily than a pattern, because the later needs to be flexible and extensible. Supporting all the variations of a pattern in a complex codebase in a single place can be challenging and in the end it may be harder to get right than maintaining the repetitive code.