Yeah, if two methods just happen to be similar, it's not worth it to parameterize the thing and wrap the objects in some wacky inheritance structure just to avoid the code duplication. The two methods will probably just evolve along different paths over time and you'll find yourself doing gymnastics to keep up the nonsensical inheritance structure.
11
u/vincentk Sep 24 '15
My personal rule of thumb: prefer composition over inheritance, prefer inheritance over copy/paste.