colllectorof
Joined 11 years ago
Joined 11 years ago
It's not, though, and the fact that people keep repeating this meme shows that most developers don't even bother thinking about issues they face beyond superficial blamesplaining.
The reason inheritance causes so many issues in languages like Java is because they are statically typed and also use classes as types[1]. Classes must be somewhere in the inheritance tree, hence you are forced into some place of that tree. To make things worse, Java has many keywords that restrict what inheritor of a class can do (private, final, etc).
Inheritance is much less troublesome in, say, Smalltalk, since the language is dynamically typed. If someone expects you to implement Foo, you can (almost always) just implement its relevant methods without explicitly extending the class. Thus, a whole host of annoying scenarios simply does not occur.
--
[1] BTW, this breaks one of the fundamental commandments of classic OOP: you should not depend on implementation details of an object, only on its message protocol. Obviously, it's impossible to be independent of implementation details if some library forces you to use a particular class.
[1] https://articlesofunity.org/2020/09/press-release-for-our-tw...
> The utterance emerged in February 2019 from Fox & Friends presenter Pete Hegseth
This is in the first paragraph. Before the subject is properly introduced and defined, before the reader even begins processing what the article says about it, the author encourages the audience to think about how barbarous and primitive Fox News is, which is guaranteed to tint everything that follows.
This is a propaganda technique and it's becoming ubiquitous in modern writing.
Empathy and benefit of the doubt for billionaires who vacation in Fiji and whose kids get a medevac flight to a major city when something goes wrong would look a bit more sane if those were commonly afforded to normal people as well. Which they aren't.