![]() |
|
Writing software can be like trying to hit a moving target. Although we hope the programming languages we use are more stable than the software we write, many forces are at work to turn even this terra firma into quicksand for programmers -- and computer book authors.
Sometimes features are added to a language by compiler vendors -- witness the extensions being added to Java by Microsoft (for the good of programmers everywhere). And a language standardization process itself adds its own share of changes, at least until a standard is final.
C++ Distilled, by Ira Pohl, presents the new C++ Standard (Draft) in 202 pages. It is a reference with some added tips on style and usage. The tips are at the end of sections and chapters -- called Dr. P's Prescriptions. They are brief, and noncontroversial. A short section gives the rationale for each of the recommendations. There is nothing off-the-wall here, and Pohl uses short code examples to illustrate points (more complete examples are available on line).
Since this book was published in 1997, I made a comparison with Chuck Allison's article, "What's New in Standard C++?" [C/C++ Users Journal, Dec. 1998]. This revealed that most of the new and changed features are covered. Some of the main topics included are: types, casts old and new, functions, classes, inheritance, RTTI, templates, exceptions, and I/Os. An STL reference is at the end. STL is a weak area of mine, and there's enough real information here to get you going.
The information of namespaces covers the std namespace, but I could find no comprehensive list of standard C++ headers. The new C++ Standard deprecates the .h for standard header file names (using #include <iostream> instead of #include <iostream.h>, for example). Most of the book uses this new approach, but the I/O chapter reverts to #include <iostream.h>. I suppose this is to avoid including the std statement in each example. For an interesting account of the travails of C++ authors trying to keep their books current (and a diatribe on the namespace issue), see Al Steven's column in Dr. Dobb's Journal [September 1997].
The C++ Standard isn't the only thing distilled in this book. The prose has been distilled too. One succinct passage is when Pohl summarizes the debate surrounding the goto statement:
"The goto statement is considered a harmful construct in most accounts of modern programming methodology."
This passage is one of the few homages to political correctness in the book. This is not the Annotated Reference Manual (ARM), which by design examines every syntax peculiarity and semantic double entendre. This is a reference that tries to describe the language as it exists, and to focus on features that are used every day.
Nor is this book obsessed with C++ history, or belaboring the changes between the old and the new -- it represents where the standard is (or was at the time of writing). There are, however, a few helpful references to the "old" woven into the narrative. For instance, I can never recall if a variable declared inside the expression at the top of a for loop is accessible after the closing brace of the loop. Pohl clears that up. (It once was, but now is not.)
Now that C++ has been restored to terra firma, you may need a book to bring you up to speed. This book is not a substitute for a language tutorial (and is not intended to be). I think it covers what's new in the language, but if you're concerned about the word "Draft" in the title, browse before you buy.
-- Doug Nickerson (Doug_Nickerson@onsetcomp.com)
| Readability |
|
| Originality |
|
| Organization |
|
| Accuracy |
|
| Consistency |
|
| Depth |
|
| Timeliness |
|
| Editing |
|
| Design |
|
| Overall Value |
|
Explanation of ERCB rating scale: No stars = unacceptable, 1 Star = marginal, 2 Stars = average, 3 Stars = above average, 4 Stars = exceptional.