3 ms·
First one was an immediate turn-off. Duplicating code once is fine. With the given example, there's no need to start building an abstract billing method and a d
by mcovey 7y ago
First one was an immediate turn-off. Duplicating code once is fine. With the given example, there's no need to start building an abstract billing method and a data structure to encapsulate the differences in billing between different countries, because there are only two countries and one is new. Wait for a pattern to emerge before refactoring, especially when such refactoring will make the code more complex and harder to reason about.