REVIEW - C++ for C Programmers

Title:

C++ for C Programmers

Author:

Ira Pohl

ISBN:

0201395193

Publisher:

Addison-Wesley Professional (1999)

Pages:

479pp

Reviewer:

Mark Easterbrook

Reviewed:

August 1999

Rating:

★☆☆☆☆

The author of a C++ book has a difficult job both from a marketing and technical viewpoint. There are numerous C++ books already, including some from the creator of the language, so for a book to attract attention it needs a unique feature that makes it stand out. This book does not have such a feature. Any teacher of C++ has a complex task introducing a complex subject such that the student learns how to correctly use the tool without getting overwhelmed with detail. In C++ this is highlighted by how classes are introduced: if simple classes are introduced without the hint that there is much more to them, then the student will get over-confident in his ability resulting in a spew of badly constructed classes, conversely, detailing everything that is needed to write good classes early on without giving a chance to practice the simple cases will discourage all but the most dedicated student. In this book, Ira Pohl falls into the former camp, although he fairly quickly expands the class vocabulary and the complexity of writing classes. This would commend the approach to me, if he had got it right. For example, he covers C++ I/O using cin, cout with the bit shift operator and operator overloading, but uses a print member function to output the instance to cout throughout the book, he also fails to consider the overhead of pass by value when overloading arithmetic operators.

A book assuming the reader is already a competent C programmer, as this title suggests to me, needs to take a different approach than one starting from scratch. On one hand, basic knowledge of C such as operator precedence and associativity, does not need to be covered in detail but only revised taking account of the addition of the C++ specific operators. On the other hand, such a competent C programmer will have invested considerable time and effort mastering such C idioms as arrays (particularly the array of characters) and the use of structures and pointers to construct data collections such as linked lists and associative lookup tables and needs to be actively encouraged to put these aside and learn how to use the STL instead. Again, this book fails to impress, spending too much time covering C features without really highlighting the changes and additions for C++ and extensive use of character arrays long after the basics of the STL have been discussed.

All books on C++ should state that knowledge of OOA&D is a pre-requisite, or, as a poor second best, start with a lesson on OO and its terminology. This book attempts the latter approach with a section starting 'OO programming is a data- centred view of programming ..' and covering the whole subject in less than 2 pages.

Each chapter completes with a section entitled 'Moving from C++ to Java', complete with example code, to explain briefly how the topics introduced could be implemented in Java. As I am not familiar with Java I cannot comment on the quality, but the shortness of the section suggests a very superficial coverage. The inclusion of Java and the profession of the author (University Professor), supports the notion that the book is probably a course book for students taking courses on C, C++ and Java, typically learning the basics of each language, but mastering none, an approach with questionable benefits, especially to potential employers.

In conclusion, not recommended.


Book cover image courtesy of Open Library.