Link to talk (youtube.com)
An interesting dive into the history of Object-oriented programming (OOP) alongside a heavy dose of strong opinions about its efficacy. It seeks to undermine claims made by proponents of OOP regarding its intended applications and subsequent purported benefits by showing that OOP was not intentionally with any specific use case or application in mind.
Notes
-
Bjarne Stroustrup (creator of C++) worked with Simula (a language designed for running simulations) to model distributed systems (a perfect fit for encapsulation) and found its class/object model (one of the first of its kind) and strong typing system very easy to work with and reason about. It later became apparent that the resulting program took an age to compile, and ran so slowly that it could produce no meaningful data. He eventually had to rewrite the entire thing in a different language to get it to work.
-
With C++ (originally called C with Classes), Bjarne aimed to take the typing and function virtualization properties of Simula into C. He also wanted to protect aspects of a system with private members, inspired by his thinking around distributed systems and the protection afforded to processes and their memory against other processes. Speaker keen to iterate that this was not intentionally designed with any specific use case in mind such as collaborating on code effectively in large teams.
-
constcomes from an OS level paradigm of files being read only, and is put forward as an example of things we assume were intentionally designed for working with software but are actually informed or inspired by other domains. -
Simulaās class design stems from wanting code re-use, using inheritance almost as a library to derive behaviour from parent classes, and has nothing to do with domain-driven design or architectural considerations for working in teams.
-
The creators of Simula (Ole-Johan Dahl & Kristen Nygaard) got the idea for classes and mutually exclusive subclasses (down to the syntax) from Tony Hoareās 1966 paper on Record Handling, who in turn was inspired by Douglas Rossā 1960 paper detailing work done in the 1950s for the Department of Defence where function pointers were included in fat structs (named plexes by Ross) as a form of implementing function virtualization.
-
Tony Hoareās paper used a switch-style sub-classing akin to āwhen e is const then⦠when e is variable thenā¦ā which provided type safety inside the
thenblocks as youād have assurances over the type ofe. Simula also inherited this under theINSPECTkeyword, but it was deliberately left out of C++ by Bjarne because he thought it broke modularity. -
Ivan Sutherland also built on Douglas Rossā concepts while building Sketchpad, namely function pointers alongside data in structs to enable virtual functions for shapes drawn to a screen.
-
Alan Kay took influence from both Sketchpad and Simula to build Smalltalk which had single inheritance, while Stroustrup built C++ with influence from Simula, and eventually had multiple inheritance.