An architectural blueprint of a multi-storey building. Photo · Amsterdam City Archives / Unsplash
Welcome to Phase 3. C taught you to lay bricks. C++ taught the industry to draw blueprints.

By 1979 C was already a smash hit. UNIX ran on it. Most universities used it. The first generation of microcomputer compilers was shipping for it. But there was a kind of program C wasn't great at: the ones with thousands of moving parts. A simulation. A graphical workstation. An office-productivity suite. Something with hundreds of types of object, all interacting, all needing to evolve over decades.

You could write those programs in C. People did. They were enormous, brittle, full of "manual conventions" — naming things customer_create and customer_destroy and hoping nobody forgot to call destroy. The same Bell Labs that gave us C noticed the friction. A Danish PhD student named Bjarne Stroustrup, who had spent his thesis on a simulation language called Simula, decided to do something about it.

The story

Stroustrup arrived at Bell Labs in 1979. He needed to write large simulations and was not enjoying the experience in C. Simula 67 — the language he'd used for his thesis — had introduced something new: classes, a way of bundling data with the operations on that data. Simula was elegant, but slow.

Stroustrup's idea, which would absorb the rest of his career, was: take Simula's classes, and put them on top of C, with no runtime overhead. Keep all the speed. Add the organisation. He started writing a preprocessor he called C with Classes, which translated extended C source into ordinary C, which then compiled normally.

By 1983 it was real. By 1985 the language had a new name and a book — The C++ Programming Language. The ++ was a deliberate joke: "C, with one increment". By 1989 ANSI began standardising it. By 1995 Microsoft had built Windows partly in C++. By 1998 the first ISO C++ standard shipped. By 2024 you could not pick up an AAA video game, a database engine, a browser, a flight-control system, a phone OS, or an AI inference framework that did not have a substantial chunk of C++ in it.

What Stroustrup actually changed

C++ added a long list of features over the decades — but the core, the part you'll spend Phase 3 learning, is small. Five ideas:

  1. Classes. Bundle data and the functions that operate on it into one named thing. Week 19.
  2. Encapsulation. Hide internal details behind a public face, so other code can't poke at them. Week 20.
  3. Inheritance. One class can extend another, adding new fields and methods while keeping the inherited ones. Week 21.
  4. Polymorphism. Different classes can answer the same call differently. Week 22.
  5. RAII (resource acquisition is initialisation). Automatic cleanup when an object goes out of scope. The single most important idea C++ added — and the most C-style thing about it. Week 24.

Together those five ideas form what people call object-oriented programming. They didn't originate in C++ — Simula had them, Smalltalk had them, even Lisp had them — but C++ made them fast, and that's what mattered. Object-oriented programming with no runtime cost. That combination took over the industry for forty years.

A taste — the same data, two ways

To make this concrete, consider how you'd represent "an account with a balance" in C and in C++.

In C — separate functions, one data type

struct Account {
    int      id;
    double   balance;
};

void account_init(struct Account *a, int id)     { a->id = id; a->balance = 0; }
void account_deposit(struct Account *a, double amt)  { a->balance += amt; }
double account_balance(const struct Account *a)      { return a->balance; }

// caller side:
struct Account a;
account_init(&a, 42);
account_deposit(&a, 100);
printf("%.2f\n", account_balance(&a));

It works. Notice the convention: every function is named account_* and takes a pointer to Account as its first argument. There's nothing in C that forces this convention; you maintain it by discipline. If somebody adds an account_close function and another team member doesn't know about it, they might write their own. Naming collisions are real. Documentation is the only glue.

In C++ — one class, methods inside

class Account {
public:
    Account(int id)             : id_(id), balance_(0) {}
    void   deposit(double amt)  { balance_ += amt; }
    double balance()     const  { return balance_; }

private:
    int     id_;
    double  balance_;
};

// caller side:
Account a(42);     // constructor runs automatically
a.deposit(100);
std::cout << a.balance();

Same data. Same operations. But three differences are real:

The C version could achieve all of this with discipline and naming conventions. The C++ version has the compiler enforce it. That's the entire pitch of object-orientation. Compilers, not memos.

Why this matters for AI

The biggest open-source AI frameworks — PyTorch (libtorch), TensorFlow's core, ONNX Runtime, llama.cpp's core code, NVIDIA's TensorRT — are all C++ codebases. Tens of millions of lines, evolving for over a decade, written by hundreds of contributors. None of those projects are realistic without classes, encapsulation, and inheritance. The OO discipline is what lets a thousand-engineer AI framework not collapse under its own weight.

You will probably never write a deep AI framework yourself. But you may very well find yourself debugging one, reading its source, or writing a small extension to it. The C++ you're about to learn over the next ten weeks is exactly the C++ those codebases use. By Week 28, you'll be able to open a PyTorch .cpp file and not feel lost.

C taught you the chef's vocabulary. C++ teaches you to organise a kitchen brigade.

What you'll cover in Phase 3

By the end of Phase 3 you'll have a working C++ skeleton in your head. The second half of the course (capstone projects, native UI bridges, AI tooling) builds entirely on that.

Try it yourself

What's next

We start tomorrow with the centre-piece of all of this — the difference between a class (a description of a kind of thing) and an object (an actual living, breathing instance of that kind). The blueprint and the building.

Week 19 is The Blueprint.

Photo credit

Photo free under the Unsplash license. Blueprint · Amsterdam City Archives.