← the matrixmodel

Capability — model

Objects and inheritance

Data and the procedures that belong to it, bundled together.

Simula needed to model a simulation: thousands of ships, each with a position and a behaviour. Procedural decomposition made a mess of it, so Dahl and Nygaard bundled data with behaviour and called the bundle a class — and invented inheritance so a ferry could be a ship without copying it.

Smalltalk then made the idea total: everything is an object, every interaction is a message, and the class hierarchy replaced the program structure. That is the direct ancestor of C++, Java, C# and every “managed” language since — and, through them, of most software you have ever written.

The trade-off

  • Inheritance couples classes in ways that are hard to undo; composition is usually the safer answer, which is why most modern designs use less of it than their authors expected.
  • Mutable shared objects make concurrent programs hard to reason about — the reason Rust, Go and Erlang all back away from shared mutable state.

Where it came from

Simula 67, 1967, in a Norwegian fjord: a class, a subclass, and instances of both.