ACMCrossroads / Xrds1-3 / Book Review: Success with C++

 

Successful C++ Book

bySaveen Reddy

Figure

Success with C++
Kris Jamsa
Jamsa Press
1994
$29.95

The cover is similar to other books published by Jamsa Press in that we find a somewhat confused canine staring back at the reader. Around his neck is a purple ribbon to which a medallion of some sort is attached. Remember that color purple. It will come back to haunt us throughout the reading of the book.

In one of the most unusual moves I have ever seen, Jamsa decided to open the book with I/O streams. I've never been any sort of fan of C++ I/O streams. So, I initially saw this as a critical mistake. I felt they were simply too complicated to start with. However, Jamsa turns what I thought was a near disaster into something quite clever. He explains them simply, quickly, and clearly. I think I/O streams are overwhelming for those new to C++, but it seems that this introductory chapter grabs the bull by the horns and tames the beast. As a result, the reader will feel comfortable as streams are used throughout the book.

The rest of the book proceeds through the various C++ topics of classes, inheritance, overloading, templates, memory allocation, virtual functions, polymorphism, scope, and references. These are all the basic topics that I expect to be covered in an introductory text, and, like the first chapter, I found the material to be very well done. What surprised me was that Jamsa actually touched on exception handling. However, he did not cover one of the newest C++ features, Run Time Type Information.

The book does not contain advanced topics for C++ experts, but it explains introductory and intermediate topics well. Throughout the text, Jamsa clearly explains concepts that took quite a while for me to discover through experimentation and consulting what seemed like a thousand other C++ books.

This book is, after all, aimed at the intermediate user of C++. So if you are looking for something that will reveal the darkest secrets of the language look elsewhere. However, Jamsa does cover the language with the necessary depth and breadth that many people, even those who would rank themselves above intermediate, will get something useful out of it. The value of the book for advanced users most likely lies in his very thorough discussion of streams. Unlike many books which simply teach you to declare some friend operators << and >>, Jamsa digs deep into the I/O stream library so that we will get a good understanding of its use. Among the topics Jamsa covers that I have typically found that others breeze by are string streams and guidelines for building a streamable class.

Besides the detail he provides in relation to I/O streams, he also spends quite a bit of time going over virtual functions and polymorphism. Virtual functions are one of the most misunderstood features of the language so I appreciate the extra effort he takes to cover this subject.

Now, back to purple. The entire book has on every page a tint of the purple that originally appeared on the dog's collar. Every code block or special text sequence is covered in some variation of it. I wouldn't have thought it possible but it looks different from other books and actually is pleasing to the eye. A terrific touch in the middle of these purple code blocks is that darker purple notes appear in the middle of a block pointing out important information of the code. He could have made those notes into actual comments, but it would have disrupted the text flow of the example. By placing them as he does it draws your attention to critical points of the programs without distracting your attention.

Overall, I found the book to be excellent for its target audience of beginning to intermediate C++ users and still very valuable to advanced users. Thus, I recommended it without hesitation for C++ programmers who are very familiar with C but know only a little C++. Advanced users should purchase it for its excellent coverage of I/O streams and virtual functions.

Copyright 2009, The Association for Computing Machinery, Inc.