Advertisement
Membership
Login
ACCU Buttons
Search in Book Reviews
Search is a simple string search in either book title or book author. The full text search is a search of the text of the review.
originally reviewed by Francis Glassborow in C Vu 12.3
This book looks promising. As part of Que's Professional series it is aimed at intermediate to advanced C++ programmers. It assumes you are familiar with the language and sets out to cover the changes made to the language during standardisation. Alas, it falls short of the standards such a book should achieve.The most glaring problem is with the example code. From silly mistakes like the misplaced parentheses in
#define max(x,y) ((x)>(y))?(x):(y)to design flaws like
string&writeToString(int symbol) { ... return *new string; }The examples are riddled with problems. One particularly appalling example is used to show that copy constructors can be defined in terms of assignment. Simplifying slightly, the code given is
class Person { char *name; public: Person&operator=( const Person&other){ if(&other != this){ delete [] name; name = new char[strlen (other.name)+1]; strcpy(name, other.name); } return *this; } Person(const Person&other) { *this = other; } };No destructor is defined, and the copy constructor will cause
delete[]to be called on an uninitialised pointer. Asking for exception-safe code would clearly be too much, but such basic detail should be correct in any C++ book, let alone one aimed at advanced programmers.
If we ignore the flaws in the examples, the accompanying text also suggests that the author may not fully understand his subject. A substantial discussion about when it is safe to call member functions from a constructor does not include pure virtual functions. The only example given of template-parameters to templates is
vector<vector<char *>>which is nothing of the sort. The placement and nothrow variants of
operator neware discussed without any mention of user-defined versions, or of the purpose of the matching versions of
operator delete. The chapter on the STL completely ignores the performance guarantees that the library provides.
The author's writing is dry and sometimes opinionated. Even when I understood the points he was trying to make, some of his explanations served only to confuse; I was sometimes reduced to checking the point in Meyers, Sutter, or Koenig, which reminded me that technical material does not have to be tedious.
The book fails my fundamental test, namely "would I leave it lying around at work." The problems with the examples alone are enough to stop me doing that. It is possible that a rewrite could produce a decent book, but I cannot recommend it as it stands -especially since the publishers seem to think it should command a premium price.
Before the author claims that Bryan is just supporting the ACCU establishment, he should note that, mostly, second reviews of books originally reviewed by me are ones that significantly disagree with me. Indeed it is my policy to give preference to such reviews. The only reason I am publishing this review is because the author insisted that a less 'biased' person review it. - Francis Glassborow