2 ms·
> The way I tie these together in phrasing it to teams is to ask yourself “Is this _necessarily_ the same or _coincidentally_ the same?”. I'm a hobbyist. One o
by 7bit 2y ago
> The way I tie these together in phrasing it to teams is to ask yourself “Is this _necessarily_ the same or _coincidentally_ the same?”.
I'm a hobbyist. One of my apps recently had the exact same five lines of code in two functions.
After some thinking I decided to leave it like that. Moving it into a third function seemed just additional work without no benefit.
My question was: if I had to change A, would I have to change B? The answer was: Perhaps, but not in all cases. And if I had to, the change would have me look at both functions anyway, so it is not that I could just forget to change B. And it would be unlikely it changes at all in the next 2 years.