Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"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.



I definitely still see it, "best practices" once enshrined, change slowly.


Wow, 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.


I concur. Many programmers, when attempting to reuse code, still reach blindly for inheritance in 2014.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: