Live data from Hacker News

If Inheritance is so bad, why does everyone use it?

buttondown.email

1–10 of 389 posts

Re: If Inheritance is so bad, why does everyone use it?

#2
huh :o) the wisdom since late 90's has been to avoid it like a plague, at least in c++ circles. for example, see numerous articles in 'guru-of-the-week' by herb-sutter.

the same wisdom can be applied elsewhere as well, there is no need to keep discovering the same truths in different contexts again, and again.

Re: If Inheritance is so bad, why does everyone use it?

#6
Here is my take on it.

At one point "Object Oriented" became "Blockchain" (or now Gen AI) of those times. You had to be "object oriented" in order to be taken seriously. This applied to everything. Even finished software products were called "built using object oriented".

The esoteric concept of inheritance became popular after that. At some point it became so popular that people figured out that it is not really a good thing.

Re: If Inheritance is so bad, why does everyone use it?

#7
post #2

huh :o) the wisdom since late 90's has been to avoid it like a plague, at least in c++ circles. for example, see numerous articles in 'guru-of-the-week' by herb-sutter. the same wisdom can be applied elsewhere as well, there is no need to keep discovering the same truths in different contexts again, and again.

Yeah in C++ especially nowadays using compile-time traits is much, much more idiomatic.

Re: If Inheritance is so bad, why does everyone use it?

#8
I think there’s a tension between the tinkerer, blogger and hobbyist side of the field, and anonymous 9–to-5 workhorse line of business programming in this discussion.

The core reason everyone uses it seems to me to be essentially the same reason the former groups hate it - it’s what everyone else does, it’s an incredibly square and “day-job”-esque approach to one’s tooling and architecture, it often reeks of bureaucracy, compartmentalization, and organizational superstructures often unrelated to the technical work, dictated primarily by managerial fiefdoms and needs to organizationally coordinate, and it’s a well-defined space with extremely predictable solutions and headaches, and therefore has very little excitement or novelty to offer.

Re: If Inheritance is so bad, why does everyone use it?

#9
post #3

IMHO inheritance works and only works for graphics related programming, e.g. GUI and games. Visual objects can be abstracted in the manner of inheritance.

Inheritance doesn't work well for games, that's why so many games take a component based approach like Unity, or full blown ECS.
Post reply on HN