Re:In Defense of Copy and Paste
by bunderbunder on Friday February 08, 2013 @02:59PM
(#5189788)
Sometimes I really wish there were a way to make violating the Liskov Substitution Principle throw a compiler error.
Re:In Defense of Copy and Paste
by codewright on Saturday February 09, 2013 @05:41PM
(#5194388)
Learn Haskell.
Re:In Defense of Copy and Paste
by lucidquiet on Friday February 08, 2013 @06:12PM
(#5190697)
/picks-up-rant-baton
Ha -- I've seen this too.
This is why I've started hating inheritance. I see people who think 3-9 class deeps inheritance trees are ok, and they then go out and design new 3-9 class deep taxonomies, and become very proud of their abstractions. Of course, most times a simple function (or lambda) will do just fine to patch over the inconsistencies. By patch I mean something like middle-ware.
So I am trying to convince the cargo cult inheritance people that there are patterns like strategy and "library of useful functions" to handle a lot of the code better. But they keep sticking on cargo cult DRY. No matter how many times I explain to them that we need to organize with repeated code, because as the future happens, and new versions of "interoperable" code will diverge in their special case handling and whatnot, we still can't repeat ourselves.
/rant
So yeah... Cargo-cult DRY is just as bad for readability and maintainability as spaghetti and big balls of mud.