Which book would you recommend for a beginner to C++? I've programmed in Java for a while and want to learn C++ now. Which book would be best for me to learn from?
Accelerated C++ or Programming principles and practice using C++?
Crossbones+ - Reputation: 2061
Posted 19 April 2013 - 10:10 PM
Accelerated C++, by far. It's even better if you have experience with another language (like Java )!
Programming Principles and Practice using C++ might be better once you have a firm grip of C++.
I'm a game programmer and computer science ninja !
Here's my 2D RPG-Ish Platformer Programmed in Python + Pygame, with a Custom Level Editor and Rendering System!
Here's my Custom IDE / Debugger Programmed in Pure Python and Designed from the Ground Up for Programming Education!
or Personal-Message me on here !
Crossbones+ - Reputation: 1571
Posted 20 April 2013 - 08:17 AM
"C++ Primer" covers C++11 and follows a similar approach to the "Accelerated C++" (useful/modern stuff first, note that it shares a co-author), but it goes into more detail (and, consequently, moves at a slower pace). Both have the same target audience -- folks who have programmed before in any programming language (including but not limited to C, pre-standard/older-standard C++, Java, C#, etc.) and want to specifically pick up knowledge of modern C++.
"Programming: Principles and Practice Using C++" is an introduction to programming (that happens to be using C++) for those completely new to programming (i.e., if you have never programmed before, don't know what a variable or a for loop is) -- it's great in its category, but I don't think you're in the target audience (given that you've programmed before) and consequently it may be moving too slow for you (that being said, it's the only one that covers GUIs, in Chapter 12, which happens to be freely available [PDF] -- a feature not in the C++ Standard, but nonetheless supported by countless libraries)
For more, see also:
Edited by Matt-D, 20 April 2013 - 08:18 AM.
Crossbones+ - Reputation: 1416
Posted 21 April 2013 - 08:07 AM
For someone who is pretty much a beginner, "Programming: Principles and Practice" is the right choice. It starts simple and fluffy, but it's very long and does actually end up discussing a wide set of C++ features.
Accelerated C++ is good if you can already program at least a little bit in another language. It's pretty thin and doesn't try to cover all of the language. The upside is that it presents stuff in a beautiful, logical progression and considers important "simple" things deeply. For instance, the idea of invariants is introduced hand in hand with loops. Another thing that I really like is that the book does not even mention pointers and dynamic memory allocation before the reader is ready to be shown a realistic example of a situation where you need to use them.
C++ Primer does not have that attitude or elegance. It looks more like a large grab bag of "all the stuff in the language and hints of how to use them". Seems informative and decently high quality, but not the same thing.
I would recommend The C++ Programming Language (4th edition) above C++ Primer. By necessity, it is also a "all of the things" type of book, but I would say it has better structure, goes deeper and is more rigorous. TCPL 4e comes out 20th of May.