Course program← Объектно ориентированное программирование
1История ООП
2Объект и Класс
3Базовые концепции ООП
4Принцип проектирования GRASP
5Принцип проектирования SOLID
6Паттерны GOF

Where OOP came from

This lesson was translated automatically – it may contain errors.

To put it quite bluntly: as long as there were no machines, programming was no problem at all; when we had a few weak computers, programming became a mild problem, and now we have gigantic computers, programming has become an equally gigantic problem.

Edsger Dijkstra, Turing Award lecture «The Humble Programmer», 1972

Every programming paradigm was born as an answer to a crisis of growth: the complexity of programs outran the tools they were written with. To see why OOP is needed, it is worth walking that path from the very beginning.

The first program predates the computer

1843 about 25 operations

The first program was written long before any computer existed – it was a «script» for Babbage’s analytical engine that computed Bernoulli numbers. Its author was the English mathematician Ada Lovelace; the Ada language was later named after her.

The whole program fit into a single table – a couple of dozen operations. You could take it in at a glance and check it in your head, so the question «how is this thing organised» simply did not arise.

Machine code and assembly

1940s – 1950s tens and hundreds of instructions

The first computers appear, and with them the first digital programs written in machine code. Assembly follows, translating human-readable commands into processor instructions.

These are the first imperative languages: a program is a sequence of commands executed one after another. Nobody thought about organising code back then – write it so that it works, then forget it. Programmers were mostly mathematicians, and their tasks rarely went beyond a single intricate formula.

A program was tens, at most hundreds of instructions. A person still holds that much in their head all at once, so no tool for organising code was needed: the author was the tool.

Procedures: the first attempt at order

1957 – 1972 thousands and tens of thousands of lines

Computers grow more powerful, tasks grow more abstract, and the need appears to extract subroutines with the language itself. That is how the first high-level languages emerge – Fortran, COBOL, BASIC and later C, where splitting a program into procedures became the central idea.

Around the same time Dijkstra writes his famous essay «Goto considered harmful» (1968). For the first time the industry took the point seriously: code must be not only working, but understandable.

The reason is simple: the program had outgrown a single person. Thousands of lines no longer fit in one head, and the procedure is the first answer to «how do you read code you have never read in full».

The software crisis

1968 – 1970s hundreds of thousands and millions of lines

By the 1960s and 1970s small algebraic scripts turn into vast stretches of code. The number of procedures grows exponentially, and the pair of enthusiastic mathematicians is replaced by a staff of programmers, each eager to change somebody else’s subroutine.

Software products of a new scale appear – operating systems. By the end of the 1960s IBM OS/360 ran to roughly a million lines and thousands of person-years of work; a system like that cannot be written by one person, let alone read by one. That is about forty thousand times Lovelace’s program, while the tools were still the same procedures.

The industry named this period exactly that – the software crisis. There was nobody to blame: the procedures worked as intended, there were simply too many of them. So what was missing was the tool itself – a way to cut a program into pieces you can hold in your head one at a time.

Where to draw those cuts took the next twenty years to work out. Next in this module: what Simula and Smalltalk answered.