4 ms·
Most of these exact same issues would be the same in C++, for sure similarly contrived examples could be contrived. > People, wake up! It doesn't have to be th
by seadan83 3y ago
Most of these exact same issues would be the same in C++, for sure similarly contrived examples could be contrived.
> People, wake up! It doesn't have to be this way. You've been sold Java's absurd contortions dressed in the emperor's new clothes as the default by universities and big corps for decades.
I think this is a very incorrect characterization. Effective Java was required reading for me in the very late 90s (decades ago). Back then it was even argued favor composition over inheritance [1]. AFAIK you'd have to go back to the 70s or 80s for inheritance to still have a good reputation (and which at the time was certainly better than a GOTO statement). The incidental complexity was later revealed to be quite profound, and a large chunk of "Effective Java" is dedicated to explaining these complexities and why and how to avoid these.
[1] https://blogs.oracle.com/javamagazine/post/java-inheritance-composition https://blogs.oracle.com/javamagazine/post/java-inheritance-...
- brazzy 3y agoInheritance is still absolutely a good thing to leverage polymorphism - but for that all you need are simple, shallow inheritance hierarchies. What has a deservedly gotten a bad reputation are ivory tower architectures with deep inheritance hierarchies that lead to things like the Abstract Factory Pattern.
- paulddraper 3y agoAbstract factory pattern isn't related to deep inheritance hierarchies.