4 ms·
Inheritance == harmful is quite an extreme position.
by beachy 11mo ago
Inheritance == harmful is quite an extreme position.
- Jtsummers 11mo agoIt may be extreme, but it's very common. It's probably the single most common argument used against OOP. If you drop out inheritance, most of the complaints about OO fall away.
- HumanOstrich 11mo agoCan you share where you've seen inheritance get dropped and it resulted in fewer complaints about OOP?
- bonesss 11mo agoOOP without inheritance is exactly what VB6 had… now its cool again, I guess.
- avadodin 11mo agoAlways has been.
- Jtsummers 11mo agoAnecdotally, yes. In work efforts where inheritance was kept to a minimum (shallow, more sensible, class structures) there were far fewer issues with both complaints and problems caused by it. Outside that, look to Go. Some people will waste a few pages and hours of their life arguing about whether it is or isn't OO, but it provides everything other OO languages provide except for inheritance (struct embedding kinda-sorta looks like inheritance, but it's composition and some syntax sugar to avoid `deeply.nested.references()`). It provides for polymorphism, encapsulation, and information hiding. The complaints about Go are never (or rarely) about its OO system.
- reorder9695 11mo agoThat position's not uncommon, but generally people who hold it prefer the rust style trait/interfaces system. To me it makes more sense, I don't care what this object is so long as it guarantees to provide me with certain functionality that I need.