3 ms·
Yeah I've definitely seen people refactor code to eliminate duplication in a way that turns out to be counter-productive a few weeks later, when it turns out th
by simonw 7y ago
Yeah I've definitely seen people refactor code to eliminate duplication in a way that turns out to be counter-productive a few weeks later, when it turns out the two places that use the code are evolving in different directions.
I'm thinking more about duplicate systems. A really common pattern in a codebase that has been around for a few years is incomplete replacements: someone builds v2 of the checkout flow, but it never quite completely reaches feature parity with v1 for all of the edge cases so both of them stuck around. Kill those!
- Aeolun 7y agoIf you refactor to avoid duplication, refactor into an interface.