We follow the rule of 3: it takes 3x the effort overall to create a reusable abstraction vs single case. So the 2nd time copy, 3rd time copying is break even (refactor if time in schedule), 4th time refactor. 3 cases also means less likely to factor around incidental similarity.
-
-
-
This is exactly the set of rules I use. I also make exceptions for functions that are very complex where inputs and outputs are very clearly defined. Should reuse if you can.
- 1 more reply
New conversation -
-
-
I fucking lost it at this replyhttps://twitter.com/alygin/status/1075322939132776448?s=19 …
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
In my work, what he says does make sense. I've seen a lot of excessive use of inheritance in jvm langs. Lots of it amounts to consolidating similar behaviors, rather than isolating them into composable pieces. But if its not easily composable, duplication might be preferred.
-
Duplication is way better than the wrong abstraction
End of conversation
New conversation -
-
-
i don't suppose you've heard of left-pad
-
That was caused by several aspects of the particular way the JS community has designed their packaging and dependency management system, not inherent to the use of external dependencies in general.
- 4 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.