SUMMARY
Casey Muradori discusses the 35-year mistake in software architecture, tracing object-oriented programming's origins and arguing for better encapsulation boundary placement.
IDEAS:
- Looking Glass, a pioneering game company, shipped the first commercial entity component system in 1998.
- Traditional OOP models draw encapsulation boundaries around objects, contrasting with system-centric approaches.
- Encapsulation boundaries are crucial for code ease, determining where access is difficult or easy.
- Mark Blank suggested separating domain models from code, making code sensible for its own structure.
- The Internet's social media allows typing anything, regardless of correctness, coherence, or politeness.
- The widespread adoption of hierarchical OOP models was not based on logical or academic studies.
- Casey Muradori's "big oops" talk analyzes 35 years of software history to pinpoint architectural missteps.
- OOP is a nebulous term, with many programmers holding their own subjective definitions of its principles.
- Bjarne Stroustrup's early papers promoted compile-time hierarchies matching domain models for C++.
- Alan Kay, Smalltalk's co-creator, later expressed reservations about inheritance, noting its difficulty.
- Early Smalltalk documentation emphasized inheritance hierarchies for powerful differential description.
- Smalltalk's base language included a path class with derived shape classes, mirroring domain models.
- Bjarne Stroustrup criticized Smalltalk for forcing inheritance, unlike C++'s optional approach.
- Stroustrup's PhD work involved simulating distributed systems, influencing his C++ design.
- Simula's class concept, excellent for direct domain mapping, greatly impressed Stroustrup in his simulations.
- Simula's type system effectively caught errors at compile time, a novel and appreciated feature then.
- Stroustrup's Simula experience revealed extremely slow runtimes, with garbage collection consuming 80% of time.
- He rewrote his simulator in BCPL, a language lacking Simula's type-checking features, due to performance.
- The original ideas for C++ did not stem from designing for large teams but for individual error checking.
- Stroustrup aimed to add Simula-like classes to C, seeking both performance and type-checking benefits.
- The concept of
const
in C++ originated from the OS metaphor of file read/write permissions. - Early C++ development used inheritance for code reuse, like linked lists, a practice later discouraged.
- Virtual functions in C++ were borrowed from Simula, prioritizing simplicity and efficiency in their design.
- Simula originated from the Norwegian Computing Center, a quasi-private/public research institute.
- Nygard and Dahl developed Simula to describe and simulate complex systems for operations research.
- Simula 67 introduced classes to solve code reuse problems, specifically for vehicle variations like trucks.
- Simula's classes combined code reuse (linked lists) with direct domain modeling (car/truck hierarchy).
- Tony Hoare's paper on record handling influenced Simula's subclassing concept, not Nygard and Dahl.
- Tony Hoare's 1966 paper included discriminated unions, a powerful programming tool for dynamic polymorphism.
- Tony Hoare's paper proposed a switch-like construct for type-safe handling of discriminated union subtypes.
- Simula originally had discriminated unions ("inspect"), but Stroustrup removed them in C++.
- The removal of discriminated unions in C++ was due to perceived modularity breakage by Stroustrup.
- Douglas T. Ross's "plex" concept, a record-like data structure, influenced Hoare's record handling.
- Sketchpad, a drawing program, significantly influenced Alan Kay's object-oriented concepts.
- MIT's Servo Mechanisms Laboratory in 1952 pioneered automated manufacturing from language descriptions.
- Douglas T. Ross, at MIT, championed structured data (plexes) over Lisp's sequential list processing.
- Ross's 1960 paper introduced plexes with data, pointers, flags, and function pointers (virtual functions).
- Sketchpad, developed by Ivan Sutherland, enabled revolutionary interactive graphics like object movement.
- Sutherland's Sketchpad introduced "rubber banding" for line drawing, a new interaction paradigm.
- Douglas Ross advised Ivan Sutherland on data modeling, leading to Sketchpad's use of plexes.
- Sketchpad's implementation included function pointers within its data structures for parametric behavior.
- Sketchpad's data structures were "fat structs," carrying space for all information due to historical reasons.
- The "ring structure" in Sketchpad enabled rapid constraint satisfaction, linking elements dynamically.
- Sketchpad's architecture allowed system parts to inspect any element, promoting an unencapsulated model.
- Casey Muradori's 1997 "Mega Man" modeler struggled with selection-based UI using OOP hierarchies.
- The "property universe" approach in Mega Man was a complex, parallel callback structure for data access.
- The Mega Man modeler's architecture was an inefficient, self-implemented entity component system.
- Alan Kay's view of Sketchpad's "omniscient" constraint solver as bad influenced OOP's direction.
- Stroustrup and Kay's backgrounds (distributed systems, molecular biology) favored isolated, messaging entities.
- C++ gained adoption partly due to its positive contributions like robust compile-time type checking.
- The 35-year mistake is the gap between early component-like systems and their widespread recognition.
- Current OOP tutorials still promote domain-model-matching compile-time hierarchies, perpetuating the mistake.
- Treacherous metaphors, working for a time, can prevent more powerful insights from emerging.
INSIGHTS
- Misplaced encapsulation boundaries, often driven by domain models, severely hinder software architecture design.
- Early programming innovations, like Simula's classes, were often byproducts of solving specific, immediate problems.
- The historical development of core programming paradigms reveals accidental discoveries, not grand designs.
- Type-checking and error prevention were primary drivers for early language features, predating modern architectural concerns.
- Performance constraints significantly shaped early programming language design, often leading to unexpected workarounds.
- Influential programming concepts, like structured data, emerged from practical engineering needs in specific domains.
- The "fat struct" or "plex" model provided flexible, data-centric structures that predate rigid class hierarchies.
- Interactivity and dynamic manipulation, as seen in Sketchpad, naturally led to component-like, introspective architectures.
- The perceived "badness" of omniscient systems by early OOP pioneers stifled the propagation of powerful architectural insights.
- Designing for "small, communicating cells" (like biological systems) proved limiting for in-memory, cohesive software.
- Focusing on solving the hardest problems in software design often yields architectures adaptable to simpler cases.
- The propagation of suboptimal architectural metaphors can persist for decades, hindering broader industry progress.
- Architectural choices should prioritize flexible thinking and intentional boundary placement, not rigid, one-size-fits-all models.
- Understanding historical context reveals that many "best practices" originated from specific constraints or personal biases.
- True architectural leverage comes from correctly identifying and placing encapsulation boundaries for a given problem.
QUOTES:
- "We want all of our systems to be the primary thing that we're going to think about." - Casey Muradori
- "For some reason oop has gotten into this mindset of compile time hierarchies that match the domain model." - Mark Blank
- "Make that be something the user experiences, but the code is done in a way that makes sense for the code." - Mark Blank
- "Encapsulation boundaries are really what we care about when we're doing architecture." - Casey Muradori
- "The encapsulation boundary in a normal oop like hierarchy is I have whatever the object is like a mech and the encapsulation boundary is around all of the things that the mech knows about." - Casey Muradori
- "This is about all of the things that are related to a system not all the things that are related to a mech." - Casey Muradori
- "Object programming is programming using inheritance." - Bjarne Stroustrup
- "Inheritance was like really powerful, but people just didn't know how to use it." - Alan Kay
- "Inheritance programming shows the power of differential description." - Smalltalk authors
- "It's like it's not actually oop, it's sparkling code or something like this." - Casey Muradori
- "He's like, look, not only does it take more space, but it also takes more processing power because we've got to reconstruct the data we actually want by plowing through these lists all the time." - Douglas T. Ross (paraphrased by Casey Muradori)
- "The most significant single thesis ever done." - Alan Kay (referring to Sutherland's Sketchpad thesis)
- "No one's ever even thought about like if I want to draw a line and then change where it is, I don't have to erase the line anymore." - Casey Muradori (describing Sutherland's discoveries)
- "At present, all generic blocks still carry space for all the information in any of them simply because of historical reasons." - Ivan Sutherland
- "The ring structure... was designed to permit rapid constraint satisfaction." - Ivan Sutherland
- "In the data storage structure, the separation of general specific is accomplished by collecting all things of one type together as chickens which belong to a generic hen." - Ivan Sutherland
- "The omniscient part was the good part, right? That was the thing that was so powerful." - Casey Muradori
- "The most treacherous metaphors are the ones that seem to work for a time because they can keep more powerful insights from bubbling up." - Alan Kay
- "It's just that compile time hierarchy that was a problem." - Casey Muradori
- "It looked more like it was like let's just redefine the problem to be simpler and solve that." - Casey Muradori
- "It's almost impossible to take something that only solves simple problems and scale it up into something that solves hard ones." - Casey Muradori
- "It's a tremendous ask to ask someone who's like inventing C++ or inventing simula to somehow get all of that." - Casey Muradori
HABITS
- Always thank event organizers for their hard work and dedication.
- Prioritize reading primary historical sources to understand original motivations and context.
- Continuously question established paradigms, even widely adopted or authoritative ones.
- Engage with the "Internet" (social media) cautiously, understanding its potential for unverified opinions.
- Seek to understand the mindset of historical figures through their writings and context.
- Embrace discomfort and challenge personal assumptions about "correct" programming practices.
- Collaborate with diverse programmers, including those with different or "older" methodologies.
- Focus on solving the hardest problems first, as solutions often scale down more easily.
- Strive for type safety in programming to catch errors at compile time, improving reliability.
- Consider using verb-oriented code structures over strict object-oriented ones for certain problems.
- Utilize discriminated unions when domain models clearly indicate mutually exclusive states.
- Employ "mixin" or feature flags for combining diverse functionalities in a flexible manner.
- Analyze and learn from past mistakes, both personal and historical, in software development.
- Avoid cargo culting practices; understand the "why" behind architectural decisions.
- Cultivate a deep curiosity, always seeking to trace ideas back to their earliest origins.
- Practice independent thought, not blindly following popular or academic trends.
- Be open to discovering powerful insights from seemingly trivial or overlooked historical artifacts.
- Prioritize performance and efficiency in core system design, as it impacts usability.
- Recognize that simple, easily teachable approaches can often outperform complex, abstract ones.
- Continuously reflect on the applicability of architectural models to the specific problem at hand.
FACTS:
- Looking Glass released Thief: The Dark Project, an early stealth action game, in 1998.
- Early PC gaming systems operated with extremely limited memory, often around 2 megabytes total.
- C++'s original name was "C with Classes," indicating its foundational additions to the C language.
- Bjarne Stroustrup developed C++ while at Bell Laboratories, known for creating Unix and C.
- Kristen Nygaard, co-creator of Simula, taught Bjarne Stroustrup the Simula language.
- Simula was designed as a simulation language, particularly for distributed systems analysis.
- Simula's garbage collector could consume 80% of runtime even without actual garbage needing collection.
- Douglas T. Ross, an influential computer scientist, invented the "plex" data structure.
- Tony Hoare, famous for quicksort, is credited with originating the idea of subclassing.
- Tony Hoare's 1966 paper, "Record Handling," introduced discriminated unions in programming.
- MIT's Servo Mechanisms Laboratory, established in 1952, focused on automated manufacturing.
- Cobol, first introduced in 1960, initially focused on data records for magnetic tape storage.
- Lisp, officially published in 1960 by John McCarthy, enabled symbolic computation.
- Ivan Sutherland largely created Sketchpad, a pioneering interactive graphics program, by himself.
- The TX series computers at MIT in the 1950s were rare for having integrated graphical displays.
- Sketchpad enabled revolutionary interactive features like moving drawn lines without erasing them.
- AutoCAD did not incorporate constraint-solving features until approximately 2007.
- Sketchpad used "hens" (sentinels) and "chickens" (linked list elements) for its data structures.
- The "ring structure" in Sketchpad facilitated rapid constraint satisfaction at runtime.
- C++ eventually incorporated multiple inheritance, unlike Smalltalk which remained single inheritance.
- Flight Unlimited, a Looking Glass game, suffered from severe memory fragmentation due to
new
/delete
overuse. - The "out of fuel" message in Flight Unlimited actually indicated memory fragmentation, not actual fuel.
- Doug Church challenged the Thief team to ensure their new architecture maintained high performance.
- Alan Kay holds a degree in molecular biology, influencing his view of software as communicating "cells."
REFERENCES
- Ultima Underworld (game)
- System Shock (game)
- Thief: The Dark Project (game)
- Quake (game)
- Mark Blank (person)
- Bjarne Stroustrup (person)
- "What is object-oriented programming" (paper by Bjarne Stroustrup)
- Alan Kay (person)
- Smalltalk (programming language)
- "The Art and Science of Smalltalk" (book)
- Adele Goldberg (person)
- C with Classes (programming language, precursor to C++)
- Java (programming language)
- Pascal (programming language)
- "Parameterized types for C++" (paper by Bjarne Stroustrup)
- ADA (programming language)
- Clu (programming language)
- Norwegian Computing Center (institute)
- Oly Johan Dahl (person)
- Kristen Nygard (person)
- Simula (programming language)
- Simula 1 (programming language version)
- Simula 67 (programming language version)
- Algol (programming language)
- Cobol 60 (programming language version)
- Tony Hoare (person, Sir C. A. R. Hoare)
- "Record Handling" (paper by Tony Hoare)
- Douglas T. Ross (person)
- Alan Blackwell (person)
- Carrie Roden (person)
- Plex (data structure concept by Douglas T. Ross)
- Objective-C (programming language)
- Burroughs B5000 (computer system)
- Sketchpad (drawing program by Ivan Sutherland)
- John McCarthy (person)
- Lisp (programming language)
- Fortran (programming language)
- Ivan Sutherland (person)
- TX0 (computer system)
- TX2 (computer system)
- Wes Clark (person)
- Claude Shannon (person)
- Thinglab (program by Alan Borning)
- Xerox PARC (research center)
- Alto (computer system)
- Chris Hecker (person)
- Sightseer (search engine, possible precursor to Google Scholar)
- Google Scholar (search engine)
- ARPANET (precursor to the Internet)
- Alpha Shapes (mathematical concept, implicit surfaces)
- Metaballs (graphics technique)
- Mega Man (software modeler by Casey Muradori)
- Rich Hickey Functor (callback mechanism)
- W3Schools (website)
- AutoCAD (software)
- Rust (programming language)
- Dennis (person, next speaker)
ONE-SENTENCE TAKEAWAY
Rigid domain-model-matching class hierarchies are a 35-year mistake, hindering software architecture by misplacing encapsulation boundaries.
RECOMMENDATIONS
- Challenge the ingrained assumption that compile-time hierarchies must mirror real-world domain models.
- Prioritize understanding and intentionally placing encapsulation boundaries for optimal software design.
- Learn from historical examples like Sketchpad, which adopted flexible, component-like data structures.
- Embrace approaches like entity component systems for their adaptability and power in complex scenarios.
- Consider verb-oriented programming styles where actions are central, not just data encapsulation.
- Utilize discriminated unions for mutually exclusive data states, enhancing type safety and clarity.
- Adopt "mixin" or feature flag patterns for combining diverse functionalities effectively and simply.
- Focus on solving the hardest architectural problems first; scalable solutions often emerge from this.
- Advocate for educational materials that promote flexible architectural thinking over rigid, prescribed models.
- Recognize that "good code" should not inherently be slow; performance is a key design consideration.
- Engage critically with programming paradigms, questioning their origins and practical applicability.
- Avoid imposing arbitrary boundaries that complicate rather than simplify programming tasks and interactions.
- Seek out and learn from experienced programmers who prioritize practical solutions over theoretical dogma.
- Promote historical awareness in software development to avoid repeating past, well-documented mistakes.
- Encourage an exploratory mindset in architecture, allowing for unusual but effective structural placements.