Skip to content
Bjarne Stroustrup: C++ | Lex Fridman Podcast #48
This video isn’t embeddableWatch on YouTube →
Lex Fridman PodcastLex Fridman Podcast

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

Bjarne Stroustrup is the creator of C++, a programming language that after 34 years is still one of the most popular and powerful languages in the world. Its focus on fast, stable, robust code underlies many of the biggest systems in the world that we have come to rely on as a society. If you're watching this on YouTube, many of the critical back-end component of YouTube are written in C++. Same goes for Google, Facebook, Amazon, Twitter, most Microsoft applications, Adobe applications, most database systems, and most physical systems that operate in the real-world like cars, robots, rockets that launch us into space and one day will land us on Mars. Thank you for listening ❤ Check out our sponsors: https://lexfridman.com/sponsors/ep48-sb See below for timestamps, and to give feedback, submit questions, contact Lex, etc. *CONTACT LEX:* *Feedback* - give feedback to Lex: https://lexfridman.com/survey *AMA* - submit questions, videos or call-in: https://lexfridman.com/ama *Hiring* - join our team: https://lexfridman.com/hiring *Other* - other ways to get in touch: https://lexfridman.com/contact *OUTLINE:* 0:00 - Introduction 1:40 - First program 2:18 - Journey to C++ 16:45 - Learning multiple languages 23:20 - Javascript 25:08 - Efficiency and reliability in C++ 31:53 - What does good code look like? 36:45 - Static checkers 41:16 - Zero-overhead principle in C++ 50:00 - Different implementation of C++ 54:46 - Key features of C++ 1:08:02 - C++ Concepts 1:18:06 - C++ Standards Process 1:28:05 - Constructors and destructors 1:31:52 - Unified theory of programming 1:38:10 - Machine learning 1:44:20 - Proudest moment *PODCAST LINKS:* - Podcast Website: https://lexfridman.com/podcast - Apple Podcasts: https://apple.co/2lwqZIr - Spotify: https://spoti.fi/2nEwCF8 - RSS: https://lexfridman.com/feed/podcast/ - Podcast Playlist: https://www.youtube.com/playlist?list=PLrAXtmErZgOdP_8GztsuKi9nrraNbKKp4 - Clips Channel: https://www.youtube.com/lexclips *SOCIAL LINKS:* - X: https://x.com/lexfridman - Instagram: https://instagram.com/lexfridman - TikTok: https://tiktok.com/@lexfridman - LinkedIn: https://linkedin.com/in/lexfridman - Facebook: https://facebook.com/lexfridman - Patreon: https://patreon.com/lexfridman - Telegram: https://t.me/lexfridman - Reddit: https://reddit.com/r/lexfridman

Lex FridmanhostBjarne Stroustrupguest
Nov 6, 20191h 47mWatch on YouTube ↗

At a glance

WHAT IT’S REALLY ABOUT

Bjarne Stroustrup on C++: Abstraction, Efficiency, and Reliable Systems

  1. Bjarne Stroustrup traces his personal journey through early languages like Algol, Simula, and C into the creation of C++, explaining how object-oriented and generic programming emerged from the need to express domain concepts as efficient user-defined types.
  2. He emphasizes C++’s core philosophy: give programmers high-level abstractions that cost no more than hand-written low-level code (the “zero-overhead” principle), enabling both performance and reliability in long‑lived, safety- and cost-critical systems.
  3. The conversation explores the history of programming languages, the role of strong but flexible type systems, templates and concepts, constructors/destructors (RAII), and the ISO standardization process that has guided C++’s evolution.
  4. Stroustrup contrasts precise, systems-level engineering with fuzzier domains like machine learning, arguing that different problem areas demand different tools but can still share deep design principles and philosophies.

IDEAS WORTH REMEMBERING

5 ideas

High-level abstractions must not sacrifice performance in systems programming.

Stroustrup’s “zero-overhead principle” demands that abstractions like classes, templates, and algorithms compile down to code as efficient as carefully hand-written low-level C or assembly, enabling C++ to power performance- and cost-critical infrastructure.

User-defined types are central: model your domain directly in the type system.

Inspired by Simula, C++ treats classes as user-defined types that should behave like built-ins in syntax and efficiency, letting developers express domain concepts (e.g., matrices, vehicles, safe integers) directly in code rather than via ad hoc conventions.

Constructors and destructors (RAII) are the key to safe, predictable resource management.

Stroustrup identifies RAII as C++’s most important idea: acquire resources in constructors and release them in destructors so memory, file handles, locks, and other resources are managed deterministically without requiring garbage collection.

Static analysis and clear guidelines are crucial for reliability in large systems.

He argues reliability comes first from simplification and good design, then from tools: language rules, coding guidelines (C++ Core Guidelines), and static analyzers that catch common errors and rule violations before runtime.

Generic programming with templates enables both code reuse and superior optimization.

Templates allow algorithms like sort or matrix operations to be written once and specialized per type at compile time, often generating faster code than manual C, while newer features like concepts add precise, compile-time constraints on template parameters.

WORDS WORTH SAVING

5 quotes

We want to raise the language to the human level, but we don't want to lose the efficiency.

— Bjarne Stroustrup

In C++, as in Simula, a class is a user-defined type.

— Bjarne Stroustrup

One of the clear answers is constructors and destructors. That is the key to C++.

— Bjarne Stroustrup

There's what you can do in a language and what you should do.

— Bjarne Stroustrup

Programming language design needs philosophy, because you are determining what people can express and how.

— Bjarne Stroustrup

Bjarne Stroustrup’s early programming experiences and influences (Algol, Simula, Assembler)History and evolution of programming languages (Fortran, ALGOL, Simula, Lisp, functional languages)Core design philosophy of C++: zero-overhead abstractions, strong static typing, RAIIObject-oriented and generic programming in C++ (classes, inheritance, templates, concepts)Reliability, safety, and static analysis in large, long‑lived systemsC++ standardization process (ISO/ANSI committees, C++98, 11, 14, 17, 20)Relationship between C++ and other domains/tools (JavaScript, ML/Haskell, Rust, machine learning/AI)

High quality AI-generated summary created from speaker-labeled transcript.

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.