The 35-Year Mistake in Object-Oriented Programming: A Deep Dive into Software Architecture and Historical Context

Better Software Conference

Summary:

This video delves into a significant "35-year mistake" in Object-Oriented Programming (OOP) stemming from the pervasive adoption of compile-time hierarchies that rigidly mirror domain models.

  • The journey begins with the Entity Component System (ECS) used by Looking Glass in 1998 for games like Thief, which organized data by system rather than by object hierarchy, proving to be efficient.
    Entity Component System (ECS) architecture
    Entity Component System (ECS) architecture [ 00:04:20 ]
  • This "mistake," defined as "a compile-time hierarchy of encapsulation that matches the domain model," was a deviation from earlier, more flexible patterns.
    The "35-year mistake" defined
    The "35-year mistake" defined [ 00:11:10 ]
  • The speaker traces this approach back through C++ (Stroustrup) and Simula (Nygaard and Dahl), who primarily focused on code reuse and type safety, but without fully realizing the architectural implications for complex systems.
  • A crucial divergence occurred with C.A.R. Hoare, who proposed mutually exclusive subclasses with type-safe discriminated unions, a concept largely lost in mainstream OOP.
    C.A.R. Hoare's discriminated union switch
    C.A.R. Hoare's discriminated union switch [ 00:46:48 ]
  • The true origins reveal even earlier, more powerful data-oriented designs: Douglas Ross's 1950s "plex" system (akin to modern structs with function pointers) and Ivan Sutherland's 1963 Sketchpad, which used an "omniscient" system to directly manipulate components across a unified data store.
    Sketchpad's data model showing constraints, variables, and topos
    Sketchpad's data model showing constraints, variables, and topos [ 01:39:15 ]
  • The speaker shares a personal anecdote from 1997, where he struggled with a complex OOP hierarchy for a level editor, inadvertently trying to implement an ECS-like system.
    Example of complex C++ OOP code from Negaman
    Example of complex C++ OOP code from Negaman [ 01:25:36 ]
  • This oversight resulted in less flexible and often more complex code, a pattern still taught in modern OOP tutorials, highlighting a lost period of architectural insight. The core issue is that seemingly effective metaphors can suppress more powerful underlying insights.

Introduction to the "Mistake" [00:00:00]

The speaker introduces a significant "35-year mistake" in software architecture, specifically within Object-Oriented Programming (OOP).

The Genesis of the "Mistake": C++ and Simula [00:16:32]

The historical roots of this problematic OOP paradigm are explored, starting with C++ and its precursor, Simula.

Tracing Back to Simula and Its Origins [00:31:47]

To understand the core ideas, the lineage is traced further back to Simula's development.

The Deeper Roots: C.A.R. Hoare and Discriminated Unions [00:41:59]

The origin of the "subclass" idea is attributed to C.A.R. Hoare, revealing a crucial divergence.

The True Genesis: Douglas Ross and Ivan Sutherland [00:50:50]

The chain of influence is traced further back, revealing the ultimate origins of these foundational ideas.

The Speaker's Personal Encounter with the "Mistake" [01:19:47]

Casey Muratori shares his personal experience encountering the "mistake" in 1997.

The Lasting Impact and The Path Forward [01:46:58]

Q&A: Further Insights [01:50:11]

The speaker answers questions, providing additional context and personal reflections.