News for hackers. Stuff that matters.
Re:If Inheritance is so bad, why does everyone use it? by BeetleB on Thursday April 11, 2024 @05:27PM (#40007007)
> I don't think inheritance is bad at all. It is very often the easiest way by far to model a problem.

I think the point of the article is that in some (very popular) languages, inheritance comes with a lot of baggage - precisely because classes in those languages support 3 different use cases. It's not saying that your usage is bad, but that your language didn't provide you with the best tool(s).

A lot of how people use classes can be solved via ADTs - which are much simpler to grok.

A lot of how people use classes can be solved via namespaces/modules, but not all languages have good support for them - so they use classes.

Etc.

There are no comments on this comment yet.