zet

Inheritance is the biggest reason OOP should die

For some stupid reason College Board insists on propagating the flawed idea of objects and inheritance in even their “modern” and “revised” curriculum designs. No wonder kids going through AP Computer Science developed by College Board don’t have a fucking clue about modern programming.

This is exactly why the only thing a Go programmer can to is use composition instead of inheritance. It is also the reason classes are completely omitted allowing any struct developer to add a method at any time fulfilling any interface without expressly declaring it is doing so. This is why Go is the best first language for modern development.

? has grady booch said that inheritance was the one thing he would change about oop if he could

ChatGPT response:

Yes, Grady Booch, a prominent figure in the field of software engineering and one of the original authors of the Unified Modeling Language (UML), has expressed critical views regarding inheritance in object-oriented programming (OOP).

Key Points from Grady Booch’s Perspective:

  1. Critique of Inheritance: • Booch has pointed out that while inheritance is a powerful tool in OOP, it often leads to issues such as tight coupling between classes, fragility in code, and challenges with complexity and maintainability.
  2. Composition Over Inheritance: • He advocates for the principle of “composition over inheritance.” This principle suggests that instead of relying heavily on inheritance hierarchies to define relationships between classes, developers should prefer composition to create flexible and modular designs.
  3. Change to OOP: • In various talks and writings, Booch has mentioned that if he could change one thing about OOP, it would be to reduce the reliance on inheritance. Instead, he promotes more robust designs through interfaces and composition, which provide greater flexibility.
  4. Code Complexity: • His sentiments align with a broader community shift towards favoring design patterns that encourage loose coupling, such as those seen in modern programming practices and languages that support traits, mixins, or interfaces.

Conclusion

Grady Booch’s thoughts on inheritance reflect a critical view of its traditional role in OOP, emphasizing a shift towards more flexible design patterns that promote better software architecture. His contributions have been influential in shaping modern software engineering practices, and many developers consider his insights when designing object-oriented systems.