Softpanorama
(slightly skeptical) Open Source Software Educational Society

May the source be with you, but remember the KISS principle ;-)

Google   


Softpanorama Bookshelf:
(slightly skeptical) Reviews of  C++ Books

Old News ;-)

Open books

C++ as the first language

Intermediate Selected Topics
(optimization, pointers, memory management)

Reference
(STL, IOstreams, etc)

Linux

Microsoft

Debugging Etc

Unlike C, which was an interesting blend of simplified PL/1 and BCPL pointer arithmetic, but still was/is a pretty simple language, C++ is a complex programming language, actually more complex than PL/1. The latter got a bad name in 70th  from structured programming and verification zealots because of complexity, accusations that now looks like a joke. To a certain extent all C family of languages can be considered as a PL/1 family as well. If you accept this, than one can think about C++ as a revenge, an coupe to raise the complexity of C back to ( and then above) the PL/1 level :-). But C++ in some respects (exceptions, strings, etc) is still inferior to the prototype :-(. C++ was influenced by Simula67 but unlike the latter,  C++ does not support coroutines and this is a major drawback from my point of view. Exception handling is pretty primitive. Garbage collection is not automatic and here C# might have an edge.

C++ supports a wide spectrum of diverse programming paradigms (especially after the revamping occurred in the last five years period) and countless high- and low-level techniques from its C heritage. During the last ten years, the power factor seems to have outperformed the complexity factor in universities and many universities started giving intro programming classes in C++ which in my opinion is a big mistake.  For any C++ programming course, whether or not you take C first, a good C book like  "The C Programming Language, 2nd edition," Kernighan/Ritchie, might help you better understand the language.

C++ is still evolving language. To a certain extent all C++ textbooks published before 1998 should now be considered obsolete. New books based on the ISO standard started to appear in late 1998 and the standard was fully implemented in compilers only in early 1999.  That means that any non-introductory book should  better be from this century, not the last century ;-) 

Universities (and even community colleges) usually propose three courses for the language:

While those three courses definitely require different books, due to complexity of the language you probably need  three or more books for each course as no book explains all C++ topics equally well: difficulties you will encounter trying to understand a particular construct might be cut in half or less if the book explains those things well. For example, for the intro course my recommended troika  would be: 

Each of the have unique strength and weaknesses. All of them can be bought with deep discounts (non-latest editions, just for peanuts). But in any case you need at least one book that contains lists of typical C++ related pitfalls and beginners errors like in A First Book of C++ From Here to There.  See  C++ Debugging. Due to included files and related macro generation, diagnostics in C++ compilers is notoriously bad and without a good list of typical errors (and maintaining your own) you might be a toast pretty soon, unless you can hire somebody to debug your homework and projects ;-).

For the same reason the availability of all examples from the book from WEB or CD is a must: it's much safer to create your own programs by modifying the existing examples, that typing them from scratch . Bu reusing already typed code you can avoid some typical but badly diagnosed C++ errors like omitting a semicolon after the class declaration. etc.  I never understood students who type examples from the book. This is not a course in typing, you better copy and modify the example in question and try to spend more time in the debugger trying to understand underling concepts and semantics of C++ constructs.

Be skeptical.  Suggestions below should be critically evaluated, but for introductory book published after 1999 the core changes are not that significant and often the quality of  the author presentation matters more than the level of adherence to the latest changes in the C++ standard or the latest fashion like programming patterns.

You can also get comments from others about any C++ book in the comp.lang.c++ newsgroup. If you're not sure if this is the book for you, try posting an inquiry there, and you might get some good feedback. 

Please remember that C++ is not the best first language and although it is possible to go from knowing absolutely nothing to being an entry level C++ programmer, it probably will take for average person at least two years. Learning C before C++ can shorten this period, sometimes substantially: C is a simpler language and thus more suitable for the intro course.

Aviod books that claim otherwise. Unless you have really great natural abilities you probably will end with a lot of frustration. Learn slowly... Do not rush to kill your interest in C++ or programming in general, if any  ;-(. The problem here is that to master the language you need to conceptualize a lot of things and to write a lot of code and that takes time -- really a lot of time, I mean years...

The best introductory C++ books  treat C++ as a better C (see for example  C++ Primer Plus or A First Book of C++). And IMHO this is the best way in the circumstances, although nothing prevent you from trying to learn C on your own in parallel with the C++.

Please avoid object-oriented fundamentalists. Object oriented constructs are important and need to be understood, but they are not all that the language contain and far from what should be used in each and every case like some stupid teachers are trying to enforce on unsuspecting students acting against their own and students' interests. Please note that stupid person is not necessary is an idiot; on the contrary he/she can be quite an intelligent person:

Stupidity is not the same as a lack of intelligence...It's an independent dimension, quality of its own. It's unwitting self-destruction, the ability to act against one's best interests... It's a typical programmers talent.

C++ is a multi-paradigm language and you can use different approaches depending on the task in hand, you do not need to be married to OO, unless you really want to ;-).  For example in his paper Object Oriented Programming Oversold! B. Jacobs wrote:

OOP became popular primarily because of GUI interfaces. In fact, many non-programmers think that "Object" in OOP means a screen object such as a button, icon, or listbox. They often talk about drag-and-drop "objects". GUI's sold products. Anything associated with GUI's was sure to get market and sales brochure attention, regardless of whether this association was accurate or not. I have even seen salary surveys from respected survey companies that have a programming classification called "GUI/OOP Programming".

Screen objects can correspond closely with OOP objects, making them allegedly easier to manipulate in a program. We do not disagree that OOP works fairly well for GUI's, but it is now being sold as the solve-all and be-all of programming.

Some argue that OOP is still important even if not dealing directly with GUI's. In our opinion, much of the hype about OOP is faddish. OOP in itself does NOT allow programs to do things that they could not do before. OOP is more of a program organizational philosophy rather than a set of new external solutions or operations.

In his old Usenix paper Objecting To Objects Stephen C. Johnson wrote

Object-oriented programming (OOP) is an ancient (25-year-old) technology, now being pushed as the answer to all the world's programming ills. While not denying that there are advantages to OOP, I argue that it is being oversold. In particular, OOP gives little support to GUI and network support, some of the biggest software problems we face today. It is difficult to constrain relationships between objects (something SmallTalk did better than C++). Fundamentally, object reuse has much more to do with the underlying models being supported than with the object-ness of the programming language. Object-oriented languages tend to burn CPU cycles, both at compile and execution time, out of proportion to the benefits they provide. In summary, the goods things about OOP are often the information hiding and consistent underlying models which derive from clean thoughts, not linguistic cliches.

Please remember that for any book you need to get a good compiler. Among them: Intel C++ compiler (free for adacemic use, Visual C++ 6.0 or .Net academic edition or at least Borland free C++ compiler available from the Borland site). Using gnu C++ compiler is possible but that's a more difficult path. Even on Linux, Intel C++ compiler should probably be used instead.

Despite its usage in Ms Windows, even question whether C++ is a viable alternative to C as a system programming language is still open to debate. There is an influential school that claims that combination of C with the scripting language (for example TCL) will get you farther and faster that plain-vanilla C++.  TCL is probably the most underutilized language that any C++ programmer can benefit from. Expect is perfect testing tool for majority of C++ programs.  See also DejaGnu

From the other hand for a lot of problem where speed is not that critical Python  or other scripting language are as good as C++.  But easier to debug because you need to write less lines of code (higher level languages in academic speak ;-) . Please beware that Java took a simplistic approach of enforcing OO as the only implementation paradigm and its JVM (Java Virtual Machine) is useless in many practical situations (server side Java is one example). Foe more skeptical information about Java please see Java links

You can walk around this limitation by using some Java compiler, but bad taste remains. Also the quality of diagnostics in Java is as bad or worse than in C++. Moreover debugging of complex errors in Java is very problematic and needs good knowledge of VM internals (Java uses virtual machine and that means that even if you know assembler for a particular platform you will not be able to debug on machine level directly).  If you do not believe me ask any professional Websphere developer and he/she will tell you a couple of impressive horror stories in no time :-). 

See my C++ links and  Skeptical OO links for more information and a critical discussion about OO benefits.

Many C and C++ experts recommend against using any book written by a certain Herbert Schildt. To see why, read the answer to question 16 of the C++ FAQ. The "Dummies" series of books is not particularly well-regarded either.

[alt.comp.lang.learn.c-c++] - FAQ list

15: What are the best books I can learn C++ from? Before going further, I should mention that I am not a C++ programmer myself, and the recommendations listed here are based on positive comments I have heard from others. The C++ equivalent of K&R2 is "The C++ Programming Language", 3rd Edition, by Bjarne Stroustrup. Experienced C++ programmers love it; however, many beginners seem to find it very hard going indeed. Like K&R2, it assumes basic familiarity with programming concepts and is not really intended for the absolute beginner. It does not assume any previous knowledge of C. http://www.research.att.com/~bs/about_3rd.html A more accessible book that is intended for beginners is "C++ Primer", 3rd Edition, by Stanley Lippman and JosИe Lajoie. This book is thorough, and conforms to the C++ standard. It is reportedly extremely clear and detailed, and, again, does not assume any previous knowledge of C. Another text I've seen particularly recommended is "C++ - How to Program", 2nd Edition, by H M Deitel and P J Deitel. Again, this text does not assume prior knowledge of C. Other texts I have seen recommended a number of times on the C++ newsgroups include the badly-named-though-often-recommended "Teach Yourself C++ in 21 days" by Jesse Liberty, "C++ Primer Plus" by Stephen Prata, and "Thinking in C++" by Bruce Eckel. Bruce Eckel has also placed a "beta" of the second edition of his "Thinking in C++" online as well. Do remember that it isn't the final version and that there might remain some as-yet undetected errors. The C++ FAQ contains some recommendations for C++ books as well.

Dr. Nikolai Bezroukov


Search Amazon by keywords:

 You can use Honor System to make a contribution, supporting this site



Copyright © 1996-2007 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

Standard disclaimer: The statements, views and opinions presented on this web page are those of the author and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

Created May 16, 1997; Last modified: February 28, 2008