The C++ Programming Language (Second Edition)

Addison-Wesley, ISBN 0-201-53992-6.

Here is the preface, the preface to the first edition, the notes to the reader, the first chapter which is a Tour of C++, a final chapter, documenting the decisions of the ANSI/ISO C++ standards committee, and some errata (based on the 9th printing).

Back Cover text:

Written by the designer of C++, Bjarne Stroustrup, The C++ Programming Language is the definitive guide to the language, its fundamental principles, and the key techniques for mastering it. The C++ Programming Language provides coverage of all C++ features, including exception handling, templates (parameterized types), and the latest ANSI/ISO extensions. The C++ Programming Language is the cornerstone of every programmer's library.


This book was published in 1991 and is not up-to-date. I have written more recent books on C++. You can find information about C++ from my homepage.
For translations, see my publication list and my cover gallery.


Here are a few paragraphs from a review of my second edition by Marshall Cline (The author of the C++ FAQ) written for "The C++ Report, vol ?? no ??" (naturally, I have picked from my favorite bits of that review, but I haven't warped the sense of the review, omitted any damning criticisms, or in any way edited the paragraphs I quote):

Here are my first impressions.

The ideal textbook for new C++ programmers would be: (1) must be ``reference quality'' wrt the language proper. (2) should explain how to use the language as a tool.

In other words, it should both say what the language *is*, as well as *how* to use it (new programmers seem to find the language's ``dark corners more quickly than can be imagined, so a reference quality text is absolutely essential).

Bjarne's new book is this ideal.

Bjarne's book does something that none of the other C++ textbooks have succeeded up to now: he integrates a tutorial on the *use* of the language along with the gnarley details of exactly what is legal. If that was where he stopped, I for one would've been thrilled (I've often commented to my classes that I'm waiting for such a book).

But he didn't stop there. Not only does it cover proper use along with a language reference manual, it also covers the rudiments of integrating object oriented *design*. There are some elided aspects of the OOD treatment (see below for details), but I'll concentrate on what it *does* cover, and I'll say that the software engineering aspects of the text are at a level that was previously available only in strictly OOD books, such as Booch's excellent text (or Wirfs-Brock et al or Rumbaugh et al, etc).

The general approach (language first, then design) is one that I personally find easy to teach from. Some will argue with me on this point, but both my learning and teaching experience has taught me that people learn first concrete, *then* abstract. ``One apple and two apples make three apples'' is mastered long before ``x + 2x = 3x''. Thus people learn new material by relating it to things they already understand, a belief that seems to be well accepted in educational circles, especially with regard to computers (cite [R. Mayer, The Psychology of How Novices Learn Computer Programming, Comp Surveys, 13 (1981), 121-41], [D. Ausubel, The use of advance organizers in the learning and retention of meaningful verbal material, J. Educ Psychol, 51 (1960), 266-74], etc).

This philosophy, if accepted, has numerous pragmatic impacts on the curriculum. For example, I teach multiple polymorphism only after the student has a firm grasp on single polymorphism (I *could* start with the ``most general case'' and worked toward simpler concepts). Again, virtual dispatching isn't covered until I thoroughly establish the basic concepts of encapsulation, classes and objects.

These decisions fit the ``Just In Time'' approach to education: don't teach an abstract (and hence powerful) concept until the student is ready to tackle problems that *require* the extra power. The abstract concepts are provided ``just in time.'' The student is thereby provided with a built-in motivation, and never has to ask, ``Why am I bothering to learn this?''

On the down side, it usually results in a spiral curriculum, so it would be faster to go directly for the most general case. Educators often complain of the long learning curve to master the paradigm + language. The need for people to ``decompress'' in the new paradigm is inevitable, but I've found it can be accelerated by the ``just in time'' approach (ex: it gives people a concrete formalism within which to express their thoughts).

Bjarne's book uses this ``just in time'' approach effectively.


The book is excellent. Every C++ programmer should have a copy.

-- Marshall Cline