The full story
The episode's narration, word for word. Numbers link to the sources below; timestamps play that moment.
The question 0:00
Last episode ended underneath Python, where the fast parts are written in C and C++ 1. Python's own interpreter is written in C as well 2. So is Linux, and what its makers call the most widely deployed database in the world, and much of the browser you might be watching this in 3,4,5,6. C took shape at Bell Labs in 1972, more than fifty years ago 7,8. In computing, that's ancient. So why is so much still built on it?
A cast-off computer 0:33
In 1969, Bell Labs was pulling out of a huge shared operating-system project called Multics 7,9. A small group, led mainly by Ken Thompson, started building something of their own 7. Thompson and Dennis Ritchie had already rewritten a space game, Space Travel, to run on a little-used computer called a PDP-7 9. It had about eight thousand words of memory and no useful software 7. So Thompson wrote a new operating system for it, Unix, in assembly language: the chip's own instructions, by name 7.
Too slow to build on 1:08
Thompson wanted something easier than assembly, so he made a smaller language called B, squeezed down from an older one called BCPL 7. But B was run by an interpreter-like scheme, and its programs were so much slower than assembly that rewriting Unix in it was out of the question 7. In 1971, on Bell Labs' new PDP-11, Ritchie began extending B 7. He added types, like characters, and wrote a compiler that produced real machine instructions 7. Soon the language deserved a name of its own, and he called it C 7.
Close to the machine 1:48
Ritchie described C as close to the machine 7. What you write maps onto the things a processor really has: whole numbers of a fixed size, and memory as one long row of numbered bytes 7. Here's a real C program, run for this episode 8. An array of four whole numbers is simply four of them side by side. On this Mac, each takes four bytes, so they sit four bytes apart, and nothing else is stored with them 8.
A third bigger, and worth it 2:18
By early 1973, C was good enough to write an operating system in, and that summer they rewrote the Unix kernel in it 7. The new version was about a third bigger than the assembly one 10. Ritchie and Thompson called that quite acceptable, because it was much easier to understand and to change, and it did more 10. Later in the decade, a C compiler that was easy to move to new machines helped carry Unix and C to other computers 7. In 1983, the pair received the ACM's Turing Award for Unix 11.
Pointing at memory 2:54
Because an array is just numbers in a row, C lets you work with their addresses directly 7. A variable that holds an address is called a pointer 7. The array's name acts as a pointer to its first number, and adding two moves two numbers along, so star a plus two gives thirty, exactly like a of two 7,8. Compare last episode, where Python's number forty-two took twenty-eight bytes 8. In C, it's just the four bytes of the number 8.
hello, world 3:27
The most famous first program, print hello, world, is in an early Bell Labs C tutorial by Brian Kernighan, usually dated 1974; he'd used the same greeting in a tutorial for B before that 12,13. Give that exact text to a modern C compiler, and it refuses, with two errors 8. C has changed since. It was standardised in 1989, and the latest version, C23, was adopted in 2024 7,14. Add the lines modern C expects, and it prints hello, world, as it has for half a century 8.
Renting your own memory 4:07
C also leaves memory to you 15. Think of memory as a long row of lockers. You ask the C library, with a function called malloc, to rent you a block of four, and it hands you the address of the first 15. You use them, and when you're done you call free to hand them back 15,8. In Python, a memory manager looks after all of that for you 16. In C, whatever you rent stays rented until you free it 15.
Why people still choose it 4:39
The team behind SQLite, the small database inside phones and browsers, has written it in C since 2000, and they've published why 4,5. Speed comes first: C is sometimes called portable assembly language, they note, as close to the hardware as you can get while still running anywhere 4. Second, nearly every system can call code written in C, which isn't true of other languages 4. At its most stripped-down, it needs only seven routines from the system, not a big runtime 4. And C is, in their words, old and boring, which they say is exactly what you want for something like SQLite 4.
A beautiful, slow simulator 5:21
In the late 1970s, at Cambridge, a PhD student called Bjarne Stroustrup was writing a simulator of a distributed computer system 17. He wrote it in Simula, a language with classes, which let him organise a big program beautifully 17. But it ran far too slowly to be useful: more than eighty percent of the time went on its garbage collector 17. He rewrote it in BCPL, C's ancestor, and called the experience horrible, but the new version ran fast enough to give him real results 17.
C with Classes 6:01
In 1979, at Bell Labs, Stroustrup set out to have both: Simula's way of organising programs, with C's speed 17. He added classes to C, and called it C with Classes 18,17. In 1983 it became C++, the plus plus being C's own symbol for add one 18. The first commercial release came in October 1985, alongside his book 18. Speed was the line he wouldn't cross: when someone measured a three percent slowdown compared with C, it was treated as unacceptable and removed 17.
Clean-up at the closing brace 6:41
A class bundles some data with the code that looks after it 18,17. In C++, a class can have a destructor, a function that runs automatically when the object goes away 19,8. Here, a locker object opens when it's created, and at the closing curly bracket its destructor runs by itself, without anyone calling it 8. Tie a piece of memory to an object like that, and its clean-up happens when the object's life ends 19. The technique is called resource acquisition is initialisation, or RAII: an awkward name for a very useful idea 19.
Where it runs 7:18
So what is still built this way? The Linux kernel is written in C 3. SQLite is in every Android phone, every iPhone, and every Firefox, Chrome and Safari browser, and its makers estimate over a trillion SQLite databases are in use 5. PostgreSQL is written in C, and MySQL in C and C++ 20,21. Chromium, the open-source base of Chrome, is written mainly in C++, and game engines like Unreal and Godot are C++ 6,22,23.
Still near the top 7:55
And people still write them. In Stack Overflow's 2025 survey, 23.5 percent of people who answered had done extensive work in C++ in the past year, and twenty-two percent in C 24. The TIOBE index, which counts search results, ranked C second and C++ third in September 2026, behind Python 25. Both languages are still updated, too: each has a new official standard from 2024 14,26.
Nobody checks the edges 8:28
So what's the catch? Remember the lockers. In a real locker room, an attendant would stop you opening a fifth locker when you've rented four. That's where the picture breaks: in C, nobody checks 15. Here's our working loop with one character changed, less than becomes less than or equal, so it writes a fifth number past the end of the block 8. The C standard calls that undefined behaviour: the program might seem fine, crash, or quietly damage other data, and the language promises nothing 15.
Caught in the act 9:04
So we only ran it with a safety net, a compiler option called AddressSanitizer, which adds a check around every memory access 27. It stopped the program at the bad write: four bytes, written zero bytes after a sixteen-byte block, on line six 8. A second bug reads a locker after handing back its key, called a use after free, and that's caught too 27,8. But clang's own documents say it typically doubles the running time 27. It's a way to find these bugs, not a cure for them.
Fair to C++ 9:39
Modern C++ does offer safer tools 28. Ask a C++ vector of four scores for number four, a fifth one counting from zero, using its at function, and it checks first, and reports the mistake instead 28,8. But the unchecked way is still there, and it's shorter to type, though from C++26 a hardened version of the library can check it too 29. Stroustrup explained the language's name this way: it isn't called D, because it doesn't remove features to fix problems 18. That keeps decades of old code working, and keeps the old risks available too 18.
Why not rewrite it all? 10:20
So why not rewrite it all in something safer? SQLite's developers say a rewrite would probably introduce far more bugs than it fixed, though they don't rule out Rust one day 4. Linux now supports Rust alongside its C 3. And the Chromium team made preventing memory bugs at source its next major project 30. How big the problem really is, and how newer languages tackle it, is a story for episode twelve.
Quirky, flawed, and an enormous success 10:50
Ritchie summed up his own language: C is quirky, flawed, and an enormous success 7. It's close to the machine, it runs almost anywhere, and nearly every system can call it 7,4. The price is that the edges are yours to check 15. And there's one more catch. Compiled C is machine code for one family of chips, so it has to be rebuilt for each kind of computer 31. What does write once, run anywhere actually mean?
Sources
Every factual claim in the episode is tied to one of these. Spotted an error? Tell us.
- Python documentation, "Extending Python with C or C++" — docs.python.org
- Python Developer's Guide (CPython) — devguide.python.org
- The Linux Kernel documentation, "Programming Language" — docs.kernel.org
- SQLite, "Why Is SQLite Coded In C" — sqlite.org
- SQLite, "Most Widely Deployed and Used Database Engine" (updated 2026-04-21) — sqlite.org
- Chromium, "Chromium coding style" (style-guide index: C++ listed first among the main… — chromium.googlesource.com
- Dennis M. Ritchie, "The Development of the C Language" (HOPL-II, 1993), Ritchie's own… — bell-labs.com
- This episode's own check, calc.py (run 2026-10-07 on an Apple silicon Mac: Apple…
- Dennis M. Ritchie, "The Evolution of the Unix Time-sharing System" (read from the… — bell-labs.com
- D. M. Ritchie and K. Thompson, "The UNIX Time-Sharing System", Communications of the… — bell-labs.com
- ACM A.M. Turing Award, Dennis M. Ritchie (read from the Internet Archive copy) — amturing.acm.org
- Brian W. Kernighan, "Programming in C: A Tutorial", Bell Laboratories (Internet… — bell-labs.com
- Wikipedia, "Hello, World!" program (History section) — en.wikipedia.org
- ISO/IEC JTC1/SC22/WG14 (the C standards committee) home page — open-std.org
- ISO/IEC JTC1/SC22/WG14, N3220, the working draft that followed C23 (same text for the… — open-std.org
- Python documentation, "Memory Management" (Python/C API) — docs.python.org
- Bjarne Stroustrup, "A History of C++: 1979-1991" (HOPL-II, 1993) — stroustrup.com
- Bjarne Stroustrup, "Bjarne Stroustrup's FAQ" — stroustrup.com
- cppreference.com, "RAII" — en.cppreference.com
- MySQL 8.4 Reference Manual, "The Main Features of MySQL" — dev.mysql.com
- PostgreSQL 18 Documentation, "Miscellaneous Coding Conventions" — postgresql.org
- Epic Games, "Epic C++ Coding Standard for Unreal Engine" (Unreal Engine 5.8 documentation) — dev.epicgames.com
- Godot Engine documentation, "Frequently asked questions" — docs.godotengine.org
- Stack Overflow Developer Survey 2025, "Technology" (programming, scripting and markup… — survey.stackoverflow.co
- TIOBE Index for September 2026 (read 2026-10-07) — tiobe.com
- Standard C++ Foundation, "The Standard" — isocpp.org
- Clang documentation, "AddressSanitizer" — clang.llvm.org
- cppreference.com, "std::vector::at" — en.cppreference.com
- cppreference.com, "std::vector::operator[]" (no bounds checking unless the… — en.cppreference.com
- The Chromium Projects, "Memory safety" — chromium.org
- Robert Nystrom, Crafting Interpreters, "A Map of the Territory" — craftinginterpreters.com
Researched and scripted with AI assistance, fact-checked claim by claim, with synthetic narration and diagrams drawn in code. How we make episodes.