Hacker News new | ask | show | jobs
by mohamedkoubaa 33 days ago
>it's kind of common knowledge

If only.

3 comments

In my experience it's mostly pushed by university professors that haven't worked in the industry since the 90s.
And thus the people who most graduates learned under, and sometimes start founding their own companies with these principles right after.
I think most university graduates from the past ~15 years are more likely to get taken in by trendy new cargo-cult fads than repeat things taught to them by dinosaurs in their boring university classes.
It took me so long to beat the following into my team: Inheritance and instantiation by default is a no-no. Use instances when state would be useful to the process, and use Inheritance when you have a lot of overlap between two processes/concepts and want to simplify/unify the code base.

Application of inheritance is a reaction to the current state of the code, not a foundation you start with.

yea it's amazing how many goofy ass "senior engineers" are still cargo-culting inheritance.