3 ms·
In this particular problem, I see that there's a certain threshold where replacing duplication with abstraction really pays off. But everyone has different view
by summerlight 3y ago
In this particular problem, I see that there's a certain threshold where replacing duplication with abstraction really pays off. But everyone has different views here and there and no one really has a good answer. So we have two choices:
1. Proactively refactor the code. This makes it a future prediction problem, which is never easy.
2. Keep it as is, refactor when it really becomes a pain. You gotta do much more work than where you made a right prediction.
Many hardcore engineers (including me) prefer the option 1 since it's more of fun, but in my experience, we're usually not great at making a good bet.