Fundamentals 11 min read

Goodbye Object‑Oriented Programming: The Collapse of Inheritance, Encapsulation, and Polymorphism

The article critiques the core pillars of object‑oriented programming—inheritance, encapsulation, and polymorphism—illustrating their practical pitfalls with real‑world analogies and code examples, and proposes containment and delegation as safer alternatives before urging a shift toward functional programming.

UC Tech Team
UC Tech Team
UC Tech Team
Goodbye Object‑Oriented Programming: The Collapse of Inheritance, Encapsulation, and Polymorphism

In this reflective essay the author, a longtime user of object‑oriented languages such as C++, Smalltalk, .NET and Java, explains why the promised reusability of OOP often fails in practice.

Inheritance – the first pillar collapses : Using a vivid "banana‑monkey jungle" metaphor, the author shows how blindly inheriting deep class hierarchies leads to tangled dependencies, exemplified by the need to pull in a class, its parent, grand‑parent, and so on, eventually breaking compilation.

The classic diamond problem is demonstrated with a Scanner/Printer/​Copier example (illustrated by images). The solution proposed is to avoid multiple inheritance and instead use Contain and Delegate patterns, where the Copier contains separate Printer and Scanner objects and delegates the start call to the desired implementation.

Fragile base‑class problem : A change in a base class’s implementation (shown with Java‑style pseudo‑code images) can silently break derived classes that rely on the original behavior, leading to double counting in an ArrayCount example. The author again recommends containment and delegation to treat base classes as black boxes.

Hierarchy problems : The article questions the usefulness of strict classification hierarchies for organizing concepts (e.g., where to place a "Documents" folder) and suggests a containment hierarchy that mirrors real‑world ownership (socks in a drawer, files in directories). Tags are presented as a flat, non‑ordered way to classify items, similar to interfaces.

Encapsulation – the second pillar collapses : While encapsulation protects object state, the reliance on reference passing creates hidden coupling. The author argues that constructors should deep‑clone incoming objects, but notes that deep cloning is often impossible for resources tied to the OS, making encapsulation unreliable.

Polymorphism – the third pillar collapses : Polymorphism is described as an under‑used feature that can be replaced by interfaces, allowing unrestricted composition without the baggage of OOP.

The piece concludes that OOP’s promises are broken, leading to a farewell to inheritance, encapsulation, and polymorphism. The author then looks forward to functional programming as a more trustworthy paradigm for future code development.

software designFunctional ProgrammingEncapsulationobject oriented programmingpolymorphismInheritancecontain-delegate
UC Tech Team
Written by

UC Tech Team

We provide high-quality technical articles on client, server, algorithms, testing, data, front-end, and more, including both original and translated content.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.