Inheritance only leads to a confusing design if misused. It's still a powerful tool for OOP, you simply need to know when and why to use it and do it wisely. There are crappy OOP designs either with inheritance AND composition. Lots of good arguments here softwareengineering.stackexchange....
"need to know when and why to use" - This argument can be applied to literally everything, then there is no point in discussing at all. Even something like, Idk, global vars for example, you can say "Well, you just need to know when and why to use". The eval() function: "Well, you just need to know when and why to use". Gotos statements: "Well, you just need to know when and why to use".
Literally everything can go bad if misused, that is a weak argument IMO.
The point is that Inheritance easily leads to misuse which causes confusion and makes it an error prone tool. Good tools should avoid users to make mistakes and the point is that Inheritance isn't one of this tools, that is what the author means by "mostly leads to".
Well, I don't apply it to literally everything, that's a poor argument. I still think that inheritance is a very powerful tool, as is polymorphism. You can't have one without the other. If you don't want to use it because you think is bad, it's your choice. I have literally hundreds of use cases in which it's exactly the tool to use.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Inheritance only leads to a confusing design if misused. It's still a powerful tool for OOP, you simply need to know when and why to use it and do it wisely. There are crappy OOP designs either with inheritance AND composition. Lots of good arguments here softwareengineering.stackexchange....
"need to know when and why to use" - This argument can be applied to literally everything, then there is no point in discussing at all. Even something like, Idk, global vars for example, you can say "Well, you just need to know when and why to use". The eval() function: "Well, you just need to know when and why to use". Gotos statements: "Well, you just need to know when and why to use".
Literally everything can go bad if misused, that is a weak argument IMO.
The point is that Inheritance easily leads to misuse which causes confusion and makes it an error prone tool. Good tools should avoid users to make mistakes and the point is that Inheritance isn't one of this tools, that is what the author means by "mostly leads to".
Well, I don't apply it to literally everything, that's a poor argument. I still think that inheritance is a very powerful tool, as is polymorphism. You can't have one without the other. If you don't want to use it because you think is bad, it's your choice. I have literally hundreds of use cases in which it's exactly the tool to use.