Object-oriented paradigm
Programming languages organized around objects that bundle state with the procedures that operate on it, combined through inheritance and late binding. Introduced in SIMULA 67 (1967) and named by Alan Kay; still the dominant style of large-scale software.
Overview
Object-oriented programming organizes a program around objects that bundle state with the procedures that act on it, combined through inheritance and late binding. SIMULA 67 introduced that combination in 1967, Alan Kay coined the term around the same time, and the style remains the dominant way large systems are structured.
Its canonical languages run from Smalltalk through Java to C#.
Code
" an object bundles state with the messages that operate on it.
Object subclass: Account [
| balance |
Account class >> new [
| r |
r := super new.
r init.
^r
]
init [ balance := 0 ]
deposit: amount [ balance := balance + amount ]
spend: amount [ balance := balance - amount ]
printOn: stream [
super printOn: stream.
stream nextPutAll: ' with balance: '.
balance printOn: stream
]
]
" objects compose by message: one asks another to act.
a := Account new.
a deposit: 125.
a deposit: 20.
a spend: 10.
a printOn: Transcript. "an Account with balance: 135
// a class is a specification that subclasses refine.
public class Account {
private int balance;
public Account(int start) { balance = start; }
public int balance() { return balance; }
}
public class Savings extends Account {
public Savings(int start) { super(start); }
}
// late binding: one message, whichever implementation answers it.
public class Account {
public virtual string Label => "account";
}
public class Savings : Account {
public override string Label => "savings";
}
Account[] accounts = { new Account(), new Savings() };
foreach (var a in accounts) Console.WriteLine(a.Label);
printOn: protocol, Java's class-and- subclass specification,
then C#'s virtual dispatch for late binding.Distinctive traits
- Objects own their state. Bundling data with the procedures that act on it stops one part of a program from silently changing another's data.
- Late binding buys substitutability. A message reaches whichever implementation answers it, so a new subtype works without editing its users.
- Classes are not essential. Rideau treats a class as a compile-time prototype for a type, making class-based object orientation a special case.
- Kay's definition was messaging, not encapsulation: messaging, local retention of state, and extreme late binding of everything.
- The consensus definition is the SIMULA trio: encapsulation, inheritance with late binding, and dynamic creation of objects at run time.
- The definition is contested, not settled. Rideau argues encapsulation covers only half of object orientation, and that message passing is not essential to it.
Status
Still dominant, and contested. Object orientation structures most large systems, but its definition remains disputed: whether encapsulation, classes, or message passing is essential, and whether it should replace functional programming rather than merely combine with it.
History
Dahl and Nygaard began SIMULA in 1961 as a simulation language; SIMULA 67, completed in 1967, introduced classes, subclasses, late binding, and dynamic object creation. Kay, working at Utah and later Xerox PARC, coined "object-oriented programming" around 1967 and built Smalltalk on that idea, leaving inheritance out at first. Stroustrup carried SIMULA's philosophy to C++ systems programmers around 1980, and Gosling's Java followed in the 1990s.
Languages using this paradigm (28)
ActionScript1998- BOBJ
- C#2002
- CafeOBJ1997
- Common Lisp1984
- Cosmos
ECMAScript1997- FOOPS
- Glam2026
- IronJS2010
- Ironwood
- JS++2011
JScript1996- JScript.NET2002
- Java1995
JavaScript1995- JavaScript OSA2001
- Managed JScript2007
- Mascara2008
- Maude1999
Newspeak2009- Oz1995
- Plush2025
- Smalltalk1972
- Spec#2005
TypeScript2012- UnrealScript1998
- Visual Basic for Applications