Re:Why inheritance sucks
by InclinedPlane on Friday August 20, 2010 @12:51PM
(#1620877)
It's called the strategy pattern. Look it up.
If you find yourself writing a lot of boilerplate code, you're doing something wrong, whether you're using inheritance or not.
Yes, I've read that book too. For many of the cases I deal with the strategy pattern is not appropriate, or creates additional complications. Try again.
Re:Why inheritance sucks
by InclinedPlane on Friday August 20, 2010 @05:41PM
(#1621721)
Should we raise this discussion to the level of concrete examples? Pastebin perhaps?
What I would like to see — at least in Java — is a keyword or annotation for instance fields to mark them as pseudo-superclasses. Then the compiler would generate all of those call-through methods automatically, unless overridden in the current class.