4 ms·
Working on any reasonably large project in a (mainstream) OO language makes dealing with someone's code that misuses inheritance incredibly likely, and design e
by silentbicycle 17y ago
Working on any reasonably large project in a (mainstream) OO language makes dealing with someone's code that misuses inheritance incredibly likely, and design errors in class hierarchies can inflict their problems on everything they touch. OO has been sold as a tool to reduce complexity, but can become a major source of it as projects develop.
Also, reading code with several levels of inheritance (more than three, perhaps) means dealing with several levels of spaghetti code - the code becomes a mess of "this does that, but no, wait, it doesn't anymore here, though here it does that except it does this first."
- moron4hire 17y agoSo design errors and language feature misuse are less likely in procedural languages like C? Come on, that's ridiculous. You can't judge a language by the people who misuse it, otherwise nobody would be using JavaScript and HTML these days. Sometimes complexity is intractable. There are no silver bullets.
- silentbicycle 17y agoSometimes complexity is intractable, sure, but I'd argue that on the balance, inheritance makes it worse. Programming to object interfaces (whether or not they're known at compile time) brings most of the same benefits without having to pigeonhole everything into trees and potentially rewrite tons of code when the design changes.