Reader-supported: when you buy through links on our site, we may earn an affiliate commission. Learn more

Cover of Programming: Principles and Practice Using C++ (2nd Edition)
Buy on AmazonBuy on Bookshop.orgListen on Audible

We earn a commission if you buy through these links. Learn more

Programming: Principles and Practice Using C++ (2nd Edition)

by Bjarne Stroustrup

A patient, exercise-heavy route into programming that teaches C++ through writing and fixing real code, with the author's own views on correctness and clarity built in.

What It's About

Programming: Principles and Practice Using C++ is a textbook for people learning to program from the beginning, written by the language's creator. Rather than opening with a syntax reference, it builds from simple input and output toward functions, classes, containers, and algorithms, with each step motivated by a small problem. Stroustrup spends real effort on the habits that separate working code from code that merely compiles: checking inputs, handling errors, testing, and writing code that others can read.

The book is long and deliberately unhurried. Chapters mix explanation with a large number of exercises and worked examples, and the pace asks you to type, run, break, and fix programs rather than skim. It relies on small teaching headers and support libraries the author provides, which keep early examples simple so beginners can focus on ideas before meeting the full standard library in detail. Later sections move into graphics, text processing, and numerical work.

Reading it feels less like browsing a manual and more like taking a course with a demanding, careful instructor. You come away able to write moderately sized programs of your own, along with a sense of why C++ is designed the way it is, which matters if you plan to use the language for years.

Read this if you…

  • are starting programming from zero and can commit to a long, exercise-driven course
  • want to learn C++ specifically and prefer a text that teaches design habits alongside syntax
  • learn best by typing code, running it, and working through problems on your own

Skip it if you…

  • want a quick reference or a short tutorial to finish a specific job task
  • already know C++ well and want in-depth coverage of the most recent language standards

Key Ideas

  1. 1

    Learning by writing and fixing programs

    The book treats exercises and debugging as the main way to learn, not a side activity. Ideas arrive alongside code you are expected to write, run, and repair. The reward is practical fluency: you learn what the compiler and the program are telling you, and you build the habit of testing your own assumptions.

  2. 2

    Correctness and error handling from the start

    Stroustrup treats checking inputs, stating what a function requires, and responding to failure as core skills rather than advanced polish. Early chapters introduce these habits, so beginners learn to ask what could go wrong before they worry about making things run quickly or look elegant.

  3. 3

    Building your own types and abstractions

    Functions and classes are presented as tools for separating what a piece of code promises from how it does the work. The book pushes you to design small types with clear interfaces, which makes later programs easier to change and reason about than a pile of loose variables.

  4. 4

    The standard library as a practical toolkit

    Containers, iterators, and algorithms are taught as a coherent way to organize data and computation. You learn to choose a suitable container, use algorithms instead of hand-written loops where that helps, and reason about the cost and behavior of these choices in everyday code.

  5. 5

    Applied topics: graphics, text, and numbers

    The later material shows programs interacting with a screen, processing text, and handling numerical problems. These sections make the earlier ideas concrete and give you projects that feel like real software rather than isolated exercises, though some of the graphics material is tied to the book's own support code.

Limitations

The book predates later C++ standards, so features added after C++14 are absent, and readers should pair it with a current reference. Its teaching headers and simplified interfaces are intentionally not how production code is usually written, so the move to standard practice takes separate effort. The length and exercise load can feel heavy without a course schedule or study partner. Some readers find the graphics and GUI material dated, and the book is not a substitute for a language reference.

Questions Readers Ask

Do I need programming experience before starting this book?
No. It is written for people who have never programmed, and it introduces basic ideas gradually. Expect the workload to be substantial, though. The exercises are where most of the learning happens, so readers who skip them tend to find later chapters much harder than they need to be.
Is it still relevant given newer versions of C++?
The core principles about clear design, error handling, and using the standard library remain useful. Specific syntax and some library advice have been superseded by later standards. Many readers use it for the foundations and then consult a current reference for newer features.
How does it compare with Stroustrup's The C++ Programming Language?
The C++ Programming Language is a comprehensive reference-style book for readers who already have some experience. This one is a teaching text that starts from the beginning and builds up through exercises. If you are new to programming, start here; if you need complete language detail, the other book is the better companion.
Published
2014
ISBN
9780321992789
Difficulty
beginner
Category
Tech

Book details and cover from Google Books.

Ready to read Programming: Principles and Practice Using C++ (2nd Edition)?

Get your copy on Amazon, or listen to it on Audible. We earn a commission if you buy through these links.

Explore More