50 of 51 people found the following review helpful
A C++ book that keeps on giving,
This review is from: Accelerated C++: Practical Programming by Example (C++ in Depth Series) (Paperback)
This is a tutorial book on C++, but it goes well beyond the basics. In fact, I'm pretty sure it covers pretty much every major language feature and implementation detail you need for robust C++ coding. As such, it merits re-reading as your understanding of C++ grows, and I say that as someone who rarely re-reads computer books. Don't worry - it packs all the important bits of C++ in under 300 pages. And allow yourself a smug pat on the back when you're confident about everything that's written here.
C++ books historically assume the reader is migrating to C++ from C, and adopt a 'ontogeny recapitulates phylogeny' style approach, introducing low level details from C, before the more advanced features. This has the effect of swamping a beginner with unnecessary complications, when in fact the abstractions of modern C++ hide memory managment and pointer issues entirely. The authors of Accelerated C++ have recognised this and introduce the likes of strings and vectors very early, so their examples actually do something practical. They use an extended example of keeping track of student homework records for many of these early chapters, and the skill with which they are able to slowly introduce new features as they extend the scope of the code is very impressive.
As a result, someone with experience of procedural programming can probably get through the first six chapters, which is just under the half the book. By which time, they've been introduced to the standard library's string class, plus various containers and algorithms. All this and not a mention of a pointer or a malloc.
After this point, however, the discussion becomes a little less hands-on, and focuses on defining your own types. The authors do this by walking through the creation of basic versions of the vector and string class. This covers issues ranging from templates to constructors and destructors, to overloading operators, and I would advise previous exposure to basic object oriented principles like encapsulation to be able to follow it fully.
Pointers and arrays are eventually introduced, and then there's a fairly involved chapter on using 'smart' pointers to manage memory. At this point, I would recommend having been previously exposed to C and to be comfortable with pointers and allocating and freeing memory.
Finally, there's a chapter on object-oriented programming, making use of polymorphism. This is not the strongest part of the book. The mechanics of polymorphism in C++ are well described, but the underlying design issues are not.
If you're looking for a book that will teach you C++ from the ground up in one sitting, forget about it. No book can do that, C++ straddles too many programming paradigms. But this book comes close. I would suggest reading as far as you can until your brain hurts, then following up with a book that has a more traditional arrangement of topics - if you have knowledge of C, then Bruce Eckel's Thinking in C++ is perfect. Then, come back to this one, you'll probably find you can get a little further before getting stuck.
With that in mind, this is a book I would unhesitatingly recommend for anyone seeking to learn C++, whatever their level of expertise. Unlike other introductory books, experienced programmers will not find themselves skipping large chunks of the introductory chapters. And if you're already using C++, but treating it just as an improved C, this will open your eyes to the C++ way of doing things.
Of all the books published on C++ over the years, some titles crop up again and again on the recommended reading lists. This unique book is one of them and it's entirely deserved. If only there were more out there like this one...