[Home Page] - [Reviews Main]
C++ The Complete Reference (2nd ed) by Herbert Schildt|
|ISBN: 0-07-882123-1 Publisher: McGraw-Hill Pages: 671pp Price: £25-95|
|Categories: beginner's c++|
|Reviewed by Bryan Scattergood in C Vu 8-3 (Mar 1996)|
To highlight some of the more obvious mistakes, consider a sentence from a discussion on how objects are passed to functions; 'When a copy of an object is generated because it is passed to a function, the object's constructor function is not called.'This is clarified on the following page: 'By default, when a copy of an objects is made, a bitwise copy occurs.'The second of these has not been correct since the publication of the second-edition of the reference manual, while the first is likely to confuse anyone new to the language.
These could merely be mistakes in the updating of the book, but there are also worrying problems with the chapters covering new language features, such as exceptions and templates. During the chapter on exceptions, the only values thrown are of simple built-in types. No mention is made of organising exceptions using class hierarchies. We are told that exceptions are preferable to the 'clumsy' setjmp and longjmp, without any mention of destructors.
The chapter on templates only covers simple type parameters to templates. Value or template parameters to templates are not discussed. The array example used to illustrate the use of templates takes its type as a parameter, but its size is given by an explicit constant.
New style casts are covered in a single side and the only discussion is of casting pointers. No mention is made of casting references and the interaction with exceptions.
The first major example is a string class. The constructors allocate memory for the string using new and check that the return value is not null. I believe that this is old behaviour, since new should throw an exception if memory is unavailable. The class also provides a concatenation operation (by overloading addition) as a non-const member function taking a non-const reference. This will prevent the use of temporaries, necessary for expressions such as a+b+c, on many modern compilers. Only copy constructors make use of const references. Less than a third of one side is given to discussion of const member functions in the entire book; more coverage is given to the use of the asm keyword.
In summary, the book has not been adequately updated from the first edition and the new chapters seem inadequate. Unfortunately, the book is sufficiently well presented that it may well withstand a quick inspection in bookstores and sell well to those wishing to learn the language. If you are unlucky enough to have already bought a copy, be warned that this book on its own will not give you a complete or accurate picture of the current state of the language, nor should the code presented be taken as good examples of C++.
To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/cp/cp000413.htmCopyright © The Association of C & C++ Users 1998-2000. All rights reserved.