The truth is you simply don't use inheritance much outside of theory. Only use it for a strict is-a relationship where you actually need to substitute it. And even then interfaces might fit your need better. Outside of that, composition feels like the way to go.
This is pretty wrong. Inheritance and polymorphism is a key feature in a lot of APIs (this meme mentions Minecraft so just look at how you'd make a Fabric mod, you gotta use inheritance and interfaces even for basic stuff).
I think they’re referring to using interfaces instead of superclasses, which is kind of doable. I don’t remember the last time I actually used the “extends” instead of “implements” keyword. Haven’t modded any minecraft though
Yeah, for me it depends on what I’m doing. Example: I extend Spring Configuration beans all the time to add additional configuration on top of or in place of the parent class.
155
u/[deleted] Apr 06 '22
[removed] — view removed comment