Best book on C++/VC++ & Templating?
I am primarily a C# programmer, having started off on C++, but never really spent as much time doing it as I feel I should have. I am now attempting to write some code in C++ to get around some limitations in C#, and need to get up to speed on Templating. The resources I have found on the web seem...incomplete, in my honest opinion. I have some free time coming up, and wouldn't mind sitting down with a good book. So, my C++ gurus, which book, if any, in your opinion, is the best one for a programmer to learn about C++ Templating from?
Many Thanks, rossryan
Posted Dec 14, 2012, 5:48 PM UTC
I assume by "templating" you mean either generic programming or template meta programming (TMP)?
Either way I would encourage you to learn C++ "correctly" then see where that takes you, this means some templates and other abstractions.
Even if right now VC++ is your only conceivable target, avoid anything thing which locks you into into, concentrate on ISO C++ for now (for getting start I strongly recommend a text editor and command line compiler regardless of platform, although this is a lot more natural on *Nix systems).
There are two books I recommend:
Between the two, I would pick Accelerated C++ then make an effort to pick up the missing C++11 stuff, but both will be great, so long as you read the Primer cover to cover.
I think it's unfair to characterize the "C++ Primer" as a bottom-up book in contrast with the "Accelerated C++" (note, that the bottom-up, C-before-C++ approach is followed by a completely unrelated but similarly entitled book called "C++ Primer Plus" -- perhaps that's a source of confusion). It's no longer true since the fourth edition when Barbara Moo (co-author of "Accelerated C++") joined Stanley Lippman and Josée Lajoie.
Straight from the horse's mouth, here's Andrew Koenig on the differences:
As opposed to bottom-up vs top-down (which describes the differences between the "C++ Primer Plus" and the "C++ Primer", respectively), there are two teaching strategies that distinguish "Accelerated C++" from "C++ Primer" (while top-down fits both):
It's still fair to say that "Accelerated C++" will offer a more, well, accelerated learning experience, but not for the reasons you suggest. For more, see http://www.drdobbs.com/learning-teaching-c-programming/184401918
Yes, I think you are probably right I probably made the Primer seem a bit more primitive then the credit it's due.
But I stand by my recommendations, AC++ is excellent for the points I mentioned, namely that it's concise and teaches excellent style.