Rating: - C++ for Java developers
Although Koenig does not mention Java in this book, clearly the richness of the Java API has influenced the evolution of C++. As a result, the way of programming in C++ has evolved to being more library-centric, that is, more API-based. Koenig gives a well-paced introduction to C++ as it is really practiced, using the most commonly used library classes. This seems exactly the right approach, and will certainly be of great use to developers who are already experienced in Java programming.
Rating: - After three years of using this book...
The "Accelerated" in the title stands for bypassing the part of programming where the programmer builds all his own tools. It does not stand for a rapid visit through all the C++ topics, nor does it stand for the kind of programmer that should use the book.
The philosophy of this book is to teach the usefulness of C++ for solving problems. It does this by reaching into the rich toolbox that comes with every compiler. This philosophy is over and against the one that emphasizes the capabilities of C++ in making tools from scratch. The reader is taught to employ the powerful C++ templates--which makes for accelerated and useful C++ programming. This book is not about C programming with objects thrown in. Nor is it about the abstract principles of C++ as compared to other languages.
I don't know of another C++ book with this philosophy and style; it is fantastic.
Early on, the authors introduce standard templates which make data management easy. They teach the associative maps, vectors, strings, I/O streams and other C++ tools. It is designed to allow the programmer to move swiftly into solving real-world problems -- versus the traditional language route that starts with scaffolding construction. Because this book promotes the language as a tool, it would be a good C++ introduction for programmers who already know Java and C#.
I have been programming in C and C++ since 1991. I lost my first C++ book a few years ago, and I replaced it with this one. I am glad for the change! This book is packed with useful examples and detailed explanations--and it is a handy reference as well. Each C++ topic is explained in wonderful detail (more detail than I recall getting in college).
By using this book, beginners will learn correctly, and old-hats will learn to enjoy the language more deeply. This C++ book is a new favorite. It certainly reads better than Strousrup's, "The C++ Programming Language" -- which is a critically important book, just written poorly.
For a light and whimsical introduction to C++ following the traditional methods, see the pleasant "Learning C++" by Neill Graham.
Rating: - The C++ Tutorial
If you have programmed before, not necessarily in C++ or C, and know the basic data structures, _Accelerated C++_ is probably the best C++ tutorial for you. If, however, you have never programmed before, you will probably want to do the exercises of an easier tutorial before using _Accelerated_. Not a primer to teach you how to program, it is a primer to teach you the fundamentals of C++. _Accelerated_ is revolutionary, because, unlike typical primers, it uses C++'s standard library often and early. To get a better idea of how revolutionary, an explanation is necessary.
Earlier versions of C++, known as "C with Classes," have been in use since 1980. But many so-called C++ tutorials still treat C++ as an extended form of C instead of the completely separate language that it is today. It has its own idiom. These tutorials, for example, use C-style string literals instead of C++'s string type and use arrays instead of C++'s vector type. This traditional way of teaching C++ results in errors and frustration among beginners--a major headache when trying to learn C and an unnecessary burden when trying to learn C++.
Fortunately, as implied, C++ has evolved, and a library--the standard library--has been developed to help programmers become productive more quickly and with less errors. _Accelerated_ is one of those few tutorials that uses this standard library early and often to quickly allow the beginner to write nontrivial programs. On page 9, for example, you are already introduced to the string type. On page 12, you are already introduced to a member function of the string type. Compare this with common primers that tack on a chapter at the end about the standard library as an afterthought.
The authors let you in on subtleties that most experienced C++ programmers know but may appear strange to novices. You learn, for example, why it is better to count from _0_ than from _1_ in for-loops. The authors never condescend. Their explanations are clear and convincing. The range of material covered and the depth of the coverage go beyond what you will find in an average tutorial. The discussion of controllable handles, for example, will probably be quite abstract for some beginners. Both authors are respected for their knowledge of C++. (Koenig is the Project Editor of the C++ standards committee.)
Not only are their technical skills outstanding, they know how to teach. Who would choose to introduce pointers at the halfway point in the book and describe them as a kind of random-access iterator and only after you have had plenty of experience using iterators? The result is an easier time learning pointers. The authors have taught C++ at Stanford University, and this ability to teach is revealed throughout the book.
At only 336 pages, you may wonder how such a small book can revolutionize learning C++, especially when other outstanding books like the special edition of _The C++ Programming Language_ by Bjarne Stroustrup is 1040 pages, and the third edition of the _C++ Primer_ by Stanley B. Lippman and Josée Lajoie is 1237 pages. Part of the reason is that the authors are excellent technical writers who have mastered the art of conciseness.
Where example code is presented, if needed later, you are asked to refer to earlier pages clearly indicated instead of the code being reproduced verbatim. Sometimes you are briefly asked to rewrite the material in a chapter using classes that the authors have provided and that you have extended. Conciseness. Koenig and Moo say that they have concentrated on those parts of C++ that "are so universally important that it is hard to be productive without understanding them."
The authors present standard C++ and ignore proprietary extensions. From the book's web site you can download source code for UNIX and similar systems, .NET, Visual C++ 6.0, and Borland C++Builder version 5 or later. There is also some support for Macintosh users. And how difficult are the exercises? The overwhelming majority is of no more than moderate difficulty with some challenging ones sprinkled in. But this is only if you do the hard work of concentrating on what is written and doing your best to complete each exercise. Many of the exercises build on your answers to previous exercises. Be extra careful, because no solutions are provided. There is no answer book. The authors should, however, have indicated each exercise's level of difficulty, as this will give you some idea of what to expect.
Do not let the long errata list discourage you. The authors are perfectionists. It is better, moreover, to have all the errata posted on the book's web site than to be pulling your hair, because just about every technical book is going to have errors. Neither the book nor, as this is written, the book's web site mention how to get started in using a compiler, so if you do not know how to use one, you will have to read the documentation that came with the compiler, ask someone, or use the Internet to find the answer.
Near the end of the book, the authors recommend, for further study, _The C++ Programming Language_. I disagree. You should buy it along with _Accelerated_ not after it. It is useful for reference and for solving some of the exercises, as you can often find hints and helpful information in this book which is considered mandatory by many professional C++ programmers.
_Accelerated_ and _The C++ Programming Language_ are widely regarded as the best as regular readers of the Usenet discussion forums alt.comp.lang.learn.c-c++, comp.lang.c++, and comp.lang.c++.moderated already know. When book recommendations are requested or the best C++ books are commented on in these forums, these books are, invariably, mentioned the most. They also received the Association of C & C++ Users' highest recommendation. These books are difficult and demand effort, patience, and persistence.
A tremendous amount of thought and care and planning went on behind the scenes before Koenig and Moo approached their word processors. If you are serious about acquiring a solid C++ foundation, there is nothing better.
Rating: - Outstanding - but Neophytes Beware
This has to be the best introduction to C++ available for someone who already understands programming, in most any other language. Also looks great for use in a C++ class or for on-the-job training where the student has access to someone for questions and discussion. But I fear a true neophyte, working in isolation, would be overpowered. By the way, this is not a C++ reference manual. If that's what you need get Stroustrup's book or Lippman's "Primer".
Rating: - Daring new way to teach C++ - successfully!
After having read this book I very much regret coming to C++ from a self-taught Pascal and C background - it could have been so much easier. Many introductory texts on C++ assume a background in one of the procedural languages and consequently start teaching the C subset of C++ first. This is, according to the authors' experience, counterproductive to understanding 'proper' C++ and programming true to it's paradigms and design. Thus they follow the radically new approach of discussing whatever (sometimes advanced) facilities C++ offers to solve a particular problem instead of going from one isolated language feature to the next. This leads to the somewhat unorthodox chapter sequence, which teaches the design of user types (classes) after introducing template functions (a feature many seasoned C++ programmers still don't know how to use effectively) or even stranger: the explanation of pointers and arrays (chapter 10) in terms of the standard library iterators and containers, which have been introduced as early as chapter 3. What I particularly liked are the useful and real world examples, although the book does cover the omni-present 'hello world' program, it otherwise fully delivers on it's promise of teaching 'practical programming by example' (subtitle). Due to this approach and the well constructed exercises at the end of each chapter the book gets the student writing non-trivial, useful programs taking full advantage of advanced C++ library features almost from day one. The authors also lead by example and show proper commenting and programming for flexibility techniques even in the smallest code fragments. This is in refreshing contrast to many an author's crime of showing the 'quick and easy' way first and the 'proper' way later.
If you read The Design and Evolution of C++ you'll soon notice the repeated mentioning of Koenig and Moo as two of the key players in the development of the language. Their in-depth knowledge and experience really shows in this work. Although the book is mainly aimed at beginners, veteran C++ programmers can still profit from it, even if only by loosing some more bad old C habits.
|