Re:On DRY and the cost of wrongful abstractions
by karmajunkie on Sunday September 18, 2016 @04:53PM
(#12527161)
If you're still willing to use the word "never" then post again in five to ten years and tell me how you feel about it then.
Re:On DRY and the cost of wrongful abstractions
by tigershark on Sunday September 18, 2016 @05:36PM
(#12527324)
10 years ago I had pretty much the same ideas that I expressed in my previous post about copy and paste.
Maybe at the time I was much more extreme given the codebase mentioned above on which I was working on.
I still don't see any argument that explains why copy and paste should be better than find a better solution, apart from laziness obviously.
No it is never a good thing because the code you write is the code that has to be tested and managed. If a routine you're going to copy paste 15 times has a bug you might not give a damn but the guy after you who has to clean up the mess might prefer this routine to be only in 1 place. The rule is simple, if some substantial logic is used at 2 different places it has to be refactored into its own component. Just like a variable has to be declared if a data is used at 2 different places, that's basic CS. If one has hard time to figure out what is what then it's a naming and documentation problem, not an "DRY code" problem.