3 ms·
"As an example, creating a function and calling it twice from two similar classes is much easier to read than inventing an intermediate class that is an ancesto
by kasey_junk 13y ago
"As an example, creating a function and calling it twice from two similar classes is much easier to read than inventing an intermediate class that is an ancestor of the two (something I see very often from the hardcore OO folks)."
You really see this a lot? As far as I can remember using inheritance over composition for de-duplicating code has been considered bad practice in OO circles for at least 15 years.
- zenbowman 13y agoI definitely still see it, "best practices" once enshrined, change slowly.
- kasey_junk 13y agoWow, that's terrible, but I'd prefer if you referred to those people as "out of date OO people" as opposed to "hardcore OO people". Even though I don't consider myself a "hardcore OO" person now, when I did this would bother me.
- mercurial 13y agoI concur. Many programmers, when attempting to reuse code, still reach blindly for inheritance in 2014.