News for hackers. Stuff that matters.
Re:The death of if/else cascades, a lightweight alternative by dunk010 on Sunday December 06, 2009 @01:44PM (#979942)
Sounds like you could use multiple inheritance / mixins.
Re:The death of if/else cascades, a lightweight alternative by barrkel on Sunday December 06, 2009 @03:48PM (#980143)
You have a configuration space, and you have a set of behaviour you want to associate with different configurations. Inheritance bundles the behaviour into something (a class) and lets you combine and override as necessary. But multiple inheritance doesn't really make your life easier - you still need to work out the order of precedence, which ancestor (trait) takes effect, etc. All this is essential complexity buried behind an ontological classification scheme that wasn't really designed for it, adding in inessential complexity.

Using a tool adapted to the job really can make life easier though.