From: rcrowley@sooth.dec.com ("Rebecca Leann Smit Crowley")
Newsgroups: rec.arts.books
Subject: Bjarne Stroustrup, _The Design and Evolution of C++_
Date: 06 Feb 1995 22:15:12 MET
Organization: Digital Equipment Corporation, Palo Alto, CA, USA
X-Newsreader: TIN [version 1.2 PL2]
If you are planning on learning C++ from a book, I would not recommend starting here.

The first half of _The Design and Evolution of C++_ is a discussion of exactly that: a chronological overview of the development of C++ from its origins as C with Classes, through the first two releases of Cfront and the writing and publication of the ARM (_The Annotated C++ Reference Manual_). Stroustrup discusses his background using Simula for his doctoral thesis, and his desire for a low-level programming language suitable for systems work which would at the same time provide language support for high level design, and, he repeatedly emphasizes, make programming more enjoyable.

This discussion provides some interesting insights into how C++ got to be what it is today. One of the frequent complaints about C++ is the sheer size of the language, which is an expected and perhaps unavoidable result of the twin goals above and the desire to provide language support for a variety of programming styles (an area better and more usefully explored by Coplien). Stroustrup often justifies the growth of the language by noting that features are never added unless they can be added in an "affordable" way (in terms of compile rate and generated code) and in a way that does not affect those who do not use the feature. Of course, not all implementions of C++ follow these guidelines, often for very good reasons (largely having to do with the complexity of the resulting compiler).

An overview of the development of a programming language by the primary designer is an excellent opportunity to judge one's successes and failures and speculate what one might have done otherwise, and Stroustrup's notes along these lines provide worthwhile insight into the language. Unfortunately, this is also an excellent opportunity to unilaterally comment on what others have had to say about one's language. For the most part, Stroustrup has resisted this temptation, but if you're interested in looking at the ugly results of failing, take a look at page 179 (the index references it under "honesty, intellectual") or the top of page 248.

The second half of this book is devoted to feature-by-feature discussion of Memory Management (which includes a discussion of why garbage collection is not part of the language), Overloading (which includes an analysis of the controversy over exponentiation that I would describe as useful altho somewhat self-serving), Multiple Inheritance (and why C++ doesn't include delegation), modifications to class access rules (including why multi-methods are not supported and how to work around the lack with double-dispatch, which is adequately described, but covered better by Coplien), the new casting notation and how it interacts with run-time type identification, templates (in which the author almost admits that he was wrong in not providing a mechanism for manually instantiating templates, and doesn't quite reinvent the Ada library mechanism in suggesting how a programming environment could avoid needing a manual mechanism), exception handling (including a summary of the resumption vs. termination debate) and namespaces (and why they are just for library designers). The very last chapter in Part II is a (largely justified) villification of the C preprocessor and how some features of C++ render it less necessary. Stroustrup does admit that a preprocessor continues to be necessary occasionally and often extremely useful; whether he is seriously considering developing C++ to a point where Cpp can be abandoned is another matter.

The second half of the book is not an implausible way for someone familiar with C++ to learn about more recent additions to C++ (as a language, or features now more commonly available in implementations). The discussion of alternate syntax and, in some cases, semantics and why they were rejected could potentially be confusing, however, and I therefore strongly recommend against this book as an early text for someone learning C++.

While the first half of the book is entertaining and readable, as well as informative, the second half of the book has little of the (simulated) objectivity of Part I that constituted a large part of its charm for me. Also, as in "the grey book" (_The C++ Programming Language_ 2nd Ed.), Part II too often engages in a combination of obscure technicalities and generalities tending towards hand-waving. Either alone would be preferable; the two together with snotty remarks about language lawyers is annoying, altho presumably a case could be made for the author taking the middle road (don't mind me; my biases are showing).

My personal recommendation would be to read the first half of this book, and enough of each of the sections on new features in part II to understand current directions in C++. If you're planning on using C++ for a large project, you could do a lot worse than read through Coplien's book. And if you have questions about specific syntax, the grey book contains the reference manual, and the current version of the ARM is (mostly) up-to-date on the most recent features (otherwise you can find your own copy of the working paper).

Rebecca Crowley
rcrowley@zso.dec.com
standard disclaimers apply

This page was last changed on Feb 08 1995, 15:23 by mfx@pobox.com. Comments and corrections welcome.