3 ms·
Using a magical construct to autogenerated the three instances also doesn't turn you into a 3x developer. Because they're never exactly the same, and you end u
by lawn 3y ago
Using a magical construct to autogenerated the three instances also doesn't turn you into a 3x developer.
Because they're never exactly the same, and you end up with heaps of special cases and handling and it would've been easier to write it three times from the beginning.
And even if they start out as exactly the same, in any non-trivial codebase that won't hold true for long.
- mjw1007 3y agoI think Master Kaimu agrees with you: http://www.thecodelesscode.com/case/97 http://www.thecodelesscode.com/case/97
- moffkalast 3y agoYeah depending on the codebase size, it's often better to opt for some copied code and keep the ravioli encapsulation than trying to abstract everything into interfaces and layers of inheritance that just end up as a massive bowl of spaghetti as soon as requirements change ever so slightly.
- Terr_ 3y agoReally it all boils down to how accurately a seasoned developer can predict the future evolution of the product. Sometimes you want duplication because you believe the different code-copies will continue to diverge and require custom alterations. Other you believe the copies will remain structurally the same while growing in number, so you hollow them out with reusable helper functions or macros or whatever.