3 ms·
You are assuming that you know upfront which of that code actually will be separate. Some of it may seem very obviously separate, but that does not mean it is
by vidarh 13y ago
You are assuming that you know upfront which of that code actually will be separate.
Some of it may seem very obviously separate, but that does not mean it is clear what the generic version will look like for all practical use cases.
E.g. a generic "move" method may look substantially different if it is to only deal with pets that walk on the ground vs. handle pets that fly too.
How much do you generalize it in advance before it is too much?
If the code really is becoming so large it is a maintenance issue, then sure, yes, separate it anyway. But do it explicitly for that reason.