REVIEW - C++ Primer Plus


C++ Primer Plus


Stephen Prata



Sams Publishing (2002)




Francis Glassborow


April 2002



Last time a reviewed the latest edition of this author's book on C. In that case he had the advantage of a language that has remained very stable for a decade, not only from the perspective of the language design but also in the way in which it has been used. The effects of the changes that C99 introduced have still to impact on general coding style. C++ is totally different. It isn't so much the changes that have been made to the language itself but the vast changes that have been happening in the way that good programmers are using it. Those writing C++ have long cut loose from C and most would not advocate learning C or a C style as a precursor to learning C++. The author is, regrettably not among those. In his notes to instructors (page xvi) we find:

It doesn't assume prior knowledge of C, so it can be used without a C prerequisite. (some programming background is desirable however)

Now to me that puts it almost head to head with Accelerated C++ but this book is well over three times the length. The very next bullet point is:

Topics are arranged so that the early chapters can be covered rapidly as review chapters for courses that do have a C prerequisite.

And that gives us the vital clue. This is an old fashioned book based on learning C++ based on C. OK so let me put aside my prejudices and try to assess this book on that basis.

It is hardly surprising that the poor student is going to have to master the intricacies of C-style strings almost from the start. However what did come as a rude shock was to find a section on universal character names in chapter three. I hardly think this is appropriate at this time. Indeed many programmers can get along quite happily without knowing about these. Unfortunately this example is typical of this book. The author appears to have no ability to filter information so that the student can keep their eye on the ball.

One thing that I always look at in books for novices and that is how the author addresses copying, in particular, copy assignment. It gives me no pleasure to report that this book is almost a decade behind the leading edge in that it is still providing the flawed exception UNsafe idiom of delete first then copy. So no credit there.

Another thing that I check is the handling of casts, and in particular the new style casts. In this case we are three quarters of the way through the book before the author deals with them. While I think that is far too late, I think that the problem is compounded by statements such as (page 772)

The purpose of this operator is to allow upcasts within a class hierarchy (such type casts being safe because of the is-a relationship) and to disallow other casts.

If you haven't guessed, he is writing about dynamic_cast. He actually does know the right answer because he earlier gives a better and more accurate description with examples (even if lacking depth).

Leaving aside the typos that litter the code, this book is ill conceived and poorly implemented. The author just throws things in because he knows about them without any coherent plan. There is no sense of structured learning here, and no sense of modern C++. He does not know what is new and what is not. He seems to have no understanding of the difference between the C and the C++ header names and calmly #include's such things as cstdlib after his using namespace std. No doubt that is the principle reason he advises readers that their compiler may need them to use the older stdlib.h header. He also places using namespace std in global scope in header files; completely unacceptable.

I could go on, but there is nothing in this book that is appropriate to the needs of someone learning C++ in the twenty-first century. It is time that Pearson Educational asked itself if it should be promoting bad books that will only reduce the revenues of other parts of the company that are publishing good books. The author of this book seems unable to discriminate between relevant and irrelevant information, sadly the publishers seem to be equally incapable of distinguishing books they should be publishing from those that they should not waste resources on.

Book cover image courtesy of Open Library.

Your Privacy

By clicking "Accept Non-Essential Cookies" you agree ACCU can store non-essential cookies on your device and disclose information in accordance with our Privacy Policy and Cookie Policy.

Current Setting: Non-Essential Cookies REJECTED

By clicking "Include Third Party Content" you agree ACCU can forward your IP address to third-party sites (such as YouTube) to enhance the information presented on this site, and that third-party sites may store cookies on your device.

Current Setting: Third Party Content EXCLUDED

Settings can be changed at any time from the Cookie Policy page.