Home Lex Fridman Notes
Lex Fridman · 2019-11-07 · 1h 47m

Bjarne Stroustrup: C++ | Lex Fridman Podcast #48

C++ creator Bjarne Stroustrup explains how abstraction, types, and zero-overhead design built one of the world's most relied-upon languages.

Bjarne Stroustrup: C++ | Lex Fridman Podcast #48
The guest

Bjarne Stroustrup — Danish computer scientist who created the C++ programming language, which after 40 years still powers critical systems at Google, Facebook, Amazon, and in cars, robots, and rockets.

The gist

Bjarne Stroustrup traces his journey through early languages like Algol 60, Simula, and Fortran, and how Simula's idea of user-defined types inspired C++. He explains the core philosophy of C++: combining high-level abstraction with the efficiency of low-level code via the zero-overhead principle. The conversation covers reliability and safety as system-wide properties, the role of static analysis and simplification in writing good code, and the long ISO standardization process behind C++ 11, 14, 17, and 20. Stroustrup also reflects on templates, concepts, constructors and destructors as the heart of the language, and why he distrusts fuzzy machine-learning approaches for safety-critical engineering.

Big reveals

  • Stroustrup says he is deliberately telling only the part of programming-language history that lies on his own path, skipping Lisp and McCarthy.
  • He names Bitcoin mining as his least favorite use of C++, saying it uses as much energy as Switzerland and mostly serves criminals.
  • He insists he never said C++ is an object-oriented language; he says it supports OOP plus several other techniques.
  • He explains the zero-overhead principle: an abstraction must not cost more than equivalent hand-written low-level code.
  • Claims C++ matrix multiplication can run faster than Fortran because the right abstraction enables loop fusion and eliminating temporaries.
  • Picks constructors and destructors as the single most beautiful feature of C++, the reason it avoids garbage collection.
  • Says the scariest AI idea is a machine-learning system handing control to a distracted human with seconds to react.
  • Reveals the first C++ standard took eight years and the second took thirteen, longer despite expecting to be faster.

Things worth remembering

  • The first program Stroustrup ever wrote, in Algol 60, calculated superellipse shapes and connected points to make star patterns.
  • Assembler and microcode work paid for his Master's degree.
  • He praises a Jason Turner CppCon talk that live-codes Pong on a Motorola 6800 to show C++ shrinking as abstraction increases.
  • Notes it is easier to recognize ugly code than to recognize beauty in code.
  • After Dennis Ritchie, Stroustrup considers himself the major contributor to modern C.
  • He had lunch with Dennis Ritchie most days for 16 years and never had a harsh word with him.
  • The first ANSI C++ standards meeting in late 1989 had about 25 people, a record turnout for such a meeting.
  • The RAII concept came into C++ in 1979, in roughly the second week of his work on 'C with Classes'.
  • He estimates around four and a half million people could pick up an improvement to C++ the next day.
  • His work let him visit telescopes on Mauna Kea, Ford's car factories, and JPL's Mars rovers.

Recommended in this episode

Books, products and media the guest or host genuinely endorsed here — with the buy link.

Affiliate link — we may earn a commission at no extra cost to you.

Guest’s ownBook

The Design and Evolution of C++

Bjarne Stroustrup

“there's a in in the book I wrote about that that sign evolution of si+ process a whole bunch of rules like that” — Bjarne Stroustrup 00:43:39
Find it on Amazon