Reviewed: July 2014
The book consists of 18 chapters on various aspects of the language, starting with data, operators and control structures and ending with various library facilities such as streams, the string class, STL containers and algorithms, random numbers and regular expressions. There are three appendixes: Rvalue references, C++11 feature summary and (rather strangely) tables of ASCII codes. Each chapter has some exercises at the end. There are numerous examples and some diagrams to explain certain things such as memory layout issues (trees, hash tables, move semantics etc). The title probably derives from the well-known book TeX for the Impatient, which says of itself “It will enable you to master TeX at a rapid pace through inquiry and experiment, but it will not lead you by the hand through the entire TeX system”.
The trouble is, the C++ book does seem to treat C++ as the primary interest. This shows in the way the book is laid out; it is organised by the classic divisions that one uses to teach programming languages. This gives the impression that it will take the reader through most of C++. This approach does not serve the impatient reader well.
I have several criticisms of the book: . Despite claims of aiming at a particular audience, the book seriously lacks focus. Several parts seem aimed at complete beginners, other parts look like reference summaries for people experienced in C++. . The book contains far too much C and code that is C-like for a book on C++. . Many of the code examples and exercises are presented in an order that seems concerned with language feature coverage. This causes many of them to require knowledge of material that is presented later (without any forward referencing). . The chapter and appendices division seems odd, almost arbitrary. There are entire chapters devoted to the old C way of doing things, e.g. the POSIX datetime functions and C I/O using printf/scanf which I would not even have mentioned or would have put in an appendix. The chapters even occur before
the better C++ way of doing the job (e.g. C strings are discussed before the STL string class). The chapters are disparate and there is nothing to link them together. Several of them could have been presented in any order (with the C stuff in appendices). This has led to a large number of chapters (20 in all).
- The exercises vary in difficulty to an amazing degree which makes me think that the author does not seriously anticipate that anyone will actually do them.
- The book was very loose with terminology. It calls exceptions ‘Structured exception handling’, it refers to lambdas as ‘lambda technology’, it describes #include as a labour-saving device, it conflates exceptions with miscellaneous runtime errors from the language or its std libraries, it refers to associative containers as ‘associated containers’, it uses preprocessor macros where modern C++ would use enums or const variables, exceptions are not caught by reference, it says that function prototyping is optional.
There are inaccuracies: The description of vector reserve says that the specified amount of space is reserved; it actually requests that the vector capacity be at least enough to contain n elements so in theory it could allocate more. The std header to include to get std::pair is
- Early on there is a section entitled ‘Dealing with the flashing console’. This is to do with what happens when one is using Windows and launching from the IDE instead of using a long-running DOS prompt and invoking the program from that. The program will terminate and take the transient DOS window with it causing a window that briefly flashes on the screen. A non-portable ‘solution’ is given which is almost immediately retracted and followed with a portable ‘solution’. In my opinion it would be much better to say that one is advised to say cin.ignore();to prevent the DOS prompt launched from the IDE from immediately terminating so that you can see any console output that may have been generated.
Some aspects of C++11 were not covered,
e.g. attributes, defaulting and deleting special member functions, emplace functions, Array<>, forward_list<>, noexcept, datetime, date, timepoint, duration, clocks, threads, synchronisation mechanisms. Now, I realise that it was not the intention to cover every feature but I think that there should have been something at the beginning to mention which features would be omitted. I think it was a mistake to exclude the C++11 date time facilities whilst having a chapter that discusses the old C way of doing things.
On the plus side, the book is very easy to read. The style is slightly informal but not too overfamiliar. The explanations and diagrams are quite good. The reference-like sections are more readable than they appear at first glance because they each contain a small example. These examples are very helpful and typically missing from similar reference sections in other books. The book is also quite short, especially considering how much is covered. Perhaps this is why it is called C++ for the Impatient. It does seem to be making an effort to impart the knowledge without extensive preamble and background explanations, just enough for practical purposes. The book has received glowing reviews from other reviewers on various web sites and this easy reading was one of the main reasons. The book is also produced to a high standard with a lay flat binding, high quality paper and high quality fonts.
Despite these good points, in my opinion the sheer number of bad points outweigh the good and result in a book which I cannot recommend.