News for hackers. Stuff that matters.
Re:If Inheritance is so bad, why does everyone use it? by pyrale on Thursday April 11, 2024 @04:30AM (#39999765)
You haven't lived life to the fullest until you've had to debug an issue in a 12-layer-of-inheritance class with the original call ping-ponging a couple dozen times across the layers and overrides everywhere.

I guess one could say this would be workable with proper tools, but the IDEs just aren't there. Move up a level in inheritance, ctrl-click on a call? It was overriden somewhere in the hierarchy, but the IDE will send you to the parent-class definition regardless.

Re:If Inheritance is so bad, why does everyone use it? by touisteur on Thursday April 11, 2024 @03:03PM (#40005613)
I have actually seen one (1) beautiful C++ codebase with very good use of OOP and multiple inheritance, and author (I was his intern) painstakingly taught me about inheritance and its good uses. He used Design and Evolution of C++ (!) as a bludgeon. It was 2006.
Re:If Inheritance is so bad, why does everyone use it? by ben7799 on Thursday April 11, 2024 @04:00PM (#40006201)
The person who wrote that would have made your life miserable if they had architected it 5 other different ways as well.
Re:If Inheritance is so bad, why does everyone use it? by Capricorn2481 on Friday April 12, 2024 @09:04PM (#40019400)
Disagree. Some things are just easier to get right than inheritance.