Computing Reviews
Today's Issue Hot Topics Search Browse Recommended My Account Log In
Review Help
Search
The C++ programming language (4th ed.)
Stroustrup B., Addison-Wesley Professional, Upper Saddle River, NJ, 2013. 1368 pp. Type: Book (978-0-321563-84-2)
Date Reviewed: Nov 17 2014

Many decades on, C++ is still one of the most popular programming languages. Learning how to use it well, however, is no simple feat. If you have to trust a source to learn from, who better than the inventor of the language himself? At least in theory, that does make sense. At 44 chapters and almost 1300 pages, reading, let alone absorbing, all of this information is not simple either. Having read the third edition, I was keen to see what changes had been made in response to the C++ 11 language standard amendments. A looming review deadline was just the motivation I needed to keep me reading all the way through.

The first part of the book starts off with a tour of C++ in more heavily expanded detail than was present in the third edition. After a history of the language’s development, the remaining four chapters provide an overview of the language and the standard library. All of the content is repeated again in later parts of the book; however, these first chapters are at the level one would expect to see in an initial programming course, including just the basics to get started because it is unlikely that anyone would have the willpower to read through 1300 pages before writing and testing his or her first bit of code. These initial chapters are also a useful indicator of what is new and what is different under the C++ 11 standard.

Part 2, with its ten chapters, covers the basics. It starts off with built-in types, their typical sizes, and how they can be declared, and it moves on to pointers, arrays, and references, and how to use them. Next comes a chapter on structures, unions, and the new enumeration classes. The chapter on statements covers the standard if, switch, while, and do and introduces the new range for. As in the previous edition, expressions are explained through the implementation of a calculator application, followed by a chapter on operators, memory management, lists, type conversions, and the new lambda expressions. The chapter on functions covers argument passing and overloading, and introduces constexpr. Following that is a chapter on exception handling and then one on namespaces and their usefulness for modularization and composition. Part 2 ends with a chapter on source file organization.

At 14 chapters, Part 3 is even heavier. The chapter on classes discusses the basics, primarily in light of concrete classes. Following that, we learn about constructors, destructors, initialization, and the new move semantics. Chapter 18 introduces operators and explains how to overload them using an example complex number type implementation. It is followed with explanations on subscripting, dereferencing, and user-defined literals, this time using a string class as the worked-through example. A chapter on class derivation is followed by one dedicated to class hierarchies, which leads neatly into a discussion of runtime type information. Next is a chapter on class and function templates, followed by how these can be applied to generic programming. There is a chapter dedicated to template specialization and one about template instantiation and name binding. Combining templates with class hierarchies is followed by a chapter on metaprogramming, which introduces variadic templates. This part of the book ends with a chapter applying most of the aforementioned concepts to the design of a matrix class.

The final part of the book contains 15 chapters on the standard library. Starting with an overview, there is a chapter dedicated to containers and another to library algorithms that can be applied to those containers. The success of both of the above can be attributed to the design of iterators, which get a chapter of their own. The chapter on resource allocation introduces the new unique_ptr and shared_ptr features, while the chapter covering utilities introduces the new additions around time handling and type generators. Strings get a chapter of their own and are followed by one on the library’s new regular expression capabilities. Chapter 38 covers input and output streams, and is followed by a chapter on localization of programs for different parts of the world. The chapter on numerics covers the standard library complex numbers implementation and the recently introduced random number engines and distributions. The next two chapters both cover wholly new additions to the library. The first is a chapter on concurrency, focusing primarily on memory models and the atomic types, while the second discusses threads and tasks. Nearing the end, there is a chapter on the C standard library and finally a chapter summarizing the C++ 11 extensions.

If it came to recommending this text to novice programmers, I would hesitate. There are many easier-to-read and simpler-to-follow texts out there. The many books by Scott Meyers jump initially to mind. What about recommending it to those that I consider better at C++ than myself? I suspect that they have probably read this book already. If you are wondering about the standard changes brought about in C++ 14, then unfortunately you will have to wait for a future edition. One aspect that I really did appreciate is that this book fully embraces the recent improvements in the language. Then again, would you expect anything less from Stroustrup?

More reviews about this item: ACCU1, ACCU2, Amazon, Dr. Dobbs

Reviewer:  Bernard Kuc Review #: CR142942 (1502-0113)
Bookmark and Share
  Reviewer Selected
Featured Reviewer
 
 
C++ (D.3.2 ... )
 
 
General (D.1.0 )
 
 
Language Constructs and Features (D.3.3 )
 
Would you recommend this review?
yes
no
Other reviews under "C++": Date
A C++ toolkit
Shapiro J., Prentice-Hall, Inc., Upper Saddle River, NJ, 1991. Type: Book (9780131276635)
Dec 1 1991
Borland C++ handbook
Pappas C., William H. I., McGraw-Hill, Inc., New York, NY, 1991. Type: Book (9780078810152)
Feb 1 1993
Going from C to C++
Traister R., Academic Press Prof., Inc., San Diego, CA, 1993. Type: Book (9780126974126)
Apr 1 1994
more...

E-Mail This Printer-Friendly
Send Your Comments
Contact Us
Reproduction in whole or in part without permission is prohibited.   Copyright 1999-2024 ThinkLoud®
Terms of Use
| Privacy Policy