Please don't touch "The C Programming Language" if you care about modern C++, as you will learn lots of idioms that are good in C, but the WRONG THING in C++.
Better learning path:
- A Tour of C++, Bjarne Stroustrup
- The C++ Programming Language, 4th Edition, Bjarne Stroustrup
- Programming: Principles and Practice Using C++, Bjarne Stroustrup
- The Design and Evolution of C++, Bjarne Stroustrup (how C compatibility got to influence C++'s design)
Additionally read everything you can from Andrei Alexandrescu and Scott Meyers.
The best introductory text to modern C++ is, in my opinion, Accelerated C++ by Moo and Koenig. It's concise and teaches the language instead of spending 6 chapters teaching fundamental algorithms (yet another broken linked list class!) or OO principles (which often results in terrible C++).
Though I also recommend this book, their example code teaches bad habits (such as assignment within conditionals and horrendous compound statements) which should be avoided in any sort of production code.
+1 for Inside the C++ Object Model. Understanding the mechanics of abstractions like virtual methods (along with stack/heap, pointers, but those are less C++-specific) makes you much more confident in what your code is doing (and why you might do it that way).
A lot of the key C++ books in my library are outdated as far as C++11 or 14, but still are pretty valuable especially for legacy code bases. Here are a few good ones that I haven't seen mentioned elsewhere in the thread.
- Sutter's Exceptional C++ books
- Dewhurst's C++ Common Knowledge and C++ Gotchas are useful.
- Sutter/Alexandrescu's "C++ Coding Standards" is good, too.
I second many of the books, but in particular "Sutter/Alexandrescu's C++ Coding Standards"
the "coding standards" is misleading, its more like a "Code Complete" for hardcore C++.
C++ FAQ Lite is not a book, but a great reference; this is useful the night before an interview. It's helpful. It certainly did help with my interview.
No mention of C++ Primer? A rather thorough (if a bit overwhelming) introduction to the language. And it teaches idiomatic C++, not just C with classes.
This is what I recommend to all my friends who want to learn C++. It's a little terse on some of the more advanced concepts but gets the job done very well.
I'm a really big fan of Effective C++ and More Effective C++.
The syntax of a language is fairly easy to grasp, and I think the more important thing is to learn how people use the language, what are the pitfalls you're likely to encounter, and how to code around them. Essentially a "best practices" guide.
It's great that C++ has these books. With some other languages its not obvious what the "best practices" books are or there don't seem to be any.
C++ provides many more ways to shoot yourself in the foot than most other languages, so it is in more need of such books.
For coding in C#, Framework Design Guidelines[1] is an excellent book. I'd argue that with a little adjustment for conventions, it applies to Java too - and IMHO Java is in more need of the advice, as test-oriented code can lead to unwieldy, overcomplex APIs, a tendency that needs tempering.
Lakos works at Bloomberg and his design principles from the book have been in use there for over a decade. The book content might seem strange for someone coding on their own, but when you have a staggering amount of C++, the order it brings to the chaos is welcome. If you wind up reading it you can see the concepts in practice in our GH repo (bloomberg/bde), which might make it an easier read.
Lakos is the most influential (to me) programming book I've ever read. It came out perfectly timed, as I was moving from lone coder to lead coder, and the videogames industry was growing from 1-2 coder teams into 5+ teams, from thousands to millions of LOC and from C to C++.
Would it be counter productive to learn C++ using Stanford School of Engineering Introduction to Computer Science Programming Abstractions[1] CS106b considering it was taught in 2008?
I cannot judge on the quality of the course, but there are a lot of horrible C++ resources (including books) out there and over the years the community has come to a kind of consent which resources are likely produce C++ programmers which shouldn't be shot on sight.
I've been looking for a good book that teaches idiomatic C++11 programming from scratch. Something like Accelerated C++ or Programming: Principles and Practice Using C++ but using C++11/14 only. Lots of the C++11 books I've found have assumed you know C++98 and say what the differences are. Anyone have any suggestions?
The 4th edition of "The C++ Programming Language" has been updated to cover C++11. Contrary to the article I think the book is very well suited to learn C++ (although not to learn programming). It takes a bottom-up approach making it suitable for people that have no previous exposure to a similar language.
Would you recommend that a novice programmer learn C++ these days? Just seems like the ROI is too little in terms of new concepts that'll be learned. I mostly suggest C -> Java/C# -> Some functional language and also Python/JS on the side.
I would. C++ is still really important for low level algorithms. One can always do some low level programming with Java or C#. But is not as effective when it's done with Java/C#.
I was asked this question,but could not come up with a good answer:Assuming someone has never programmed before,but has the (mis)fortune of using C++(e.g that is what the school he/she is enrolled in uses) what would be the best book to start with?
This is pretty far from an introductory C++ book, but I'd like to mention "Modern C++ Design" by Andrei Alexandrescu. Back when I was writing C++ code, this was the book that really opened my eyes to what you could do with the language.
[+] [-] pjmlp|12 years ago|reply
Better learning path:
- A Tour of C++, Bjarne Stroustrup
- The C++ Programming Language, 4th Edition, Bjarne Stroustrup
- Programming: Principles and Practice Using C++, Bjarne Stroustrup
- The Design and Evolution of C++, Bjarne Stroustrup (how C compatibility got to influence C++'s design)
Additionally read everything you can from Andrei Alexandrescu and Scott Meyers.
Then maybe, read The C Programming Language.
[+] [-] stormbrew|12 years ago|reply
[+] [-] sfk|12 years ago|reply
If you know C already, the pace of the book is so slow that you'll lose interest.
[+] [-] kupo|12 years ago|reply
[+] [-] twoodfin|12 years ago|reply
Stroustrup's The Design and Evolution of C++ is another great "why" book, and I hope that Bjarne will decide to update it for C++11 or 14.
It's older, but reading Lippman's Inside the C++ Object Model is what finally made the language click for me.
[+] [-] Rusky|12 years ago|reply
[+] [-] IvyMike|12 years ago|reply
- Sutter's Exceptional C++ books
- Dewhurst's C++ Common Knowledge and C++ Gotchas are useful.
- Sutter/Alexandrescu's "C++ Coding Standards" is good, too.
[+] [-] BatFastard|12 years ago|reply
[+] [-] yeukhon|12 years ago|reply
http://www.parashift.com/c++-faq/
A book I like is C++ Primer.
In any case, this list on SO is pretty cool. http://stackoverflow.com/questions/388242/the-definitive-c-b...
[+] [-] DerKommissar|12 years ago|reply
[+] [-] dfkf|12 years ago|reply
[+] [-] idbfs|12 years ago|reply
[+] [-] banachtarski|12 years ago|reply
[+] [-] Tiktaalik|12 years ago|reply
The syntax of a language is fairly easy to grasp, and I think the more important thing is to learn how people use the language, what are the pitfalls you're likely to encounter, and how to code around them. Essentially a "best practices" guide.
It's great that C++ has these books. With some other languages its not obvious what the "best practices" books are or there don't seem to be any.
[+] [-] barrkel|12 years ago|reply
For coding in C#, Framework Design Guidelines[1] is an excellent book. I'd argue that with a little adjustment for conventions, it applies to Java too - and IMHO Java is in more need of the advice, as test-oriented code can lead to unwieldy, overcomplex APIs, a tendency that needs tempering.
[1] http://www.amazon.com/Framework-Design-Guidelines-Convention...
[+] [-] DerKommissar|12 years ago|reply
[+] [-] justin66|12 years ago|reply
Wow, that's bad advice.
[+] [-] nikbackm|12 years ago|reply
Since it's a little old now, can anyone tell how well it still stands up today? Are there any rules/guidelines from the book that are outdated?
[+] [-] apaprocki|12 years ago|reply
[+] [-] Jare|12 years ago|reply
[+] [-] IvyMike|12 years ago|reply
[+] [-] reality_czech|12 years ago|reply
http://yosefk.com/c++fqa/
[+] [-] donniezazen|12 years ago|reply
[1]http://see.stanford.edu/see/courseinfo.aspx?coll=11f4f422-56...
[+] [-] pmr_|12 years ago|reply
http://stackoverflow.com/questions/388242/the-definitive-c-b... is probably the most comprehensive list right now.
[+] [-] kasperset|12 years ago|reply
[+] [-] zaphoyd|12 years ago|reply
[+] [-] pmr_|12 years ago|reply
[+] [-] jbeja|12 years ago|reply
[+] [-] Tiktaalik|12 years ago|reply
http://www.artima.com/shop/overview_of_the_new_cpp
[+] [-] curiousDog|12 years ago|reply
[+] [-] pesnk|12 years ago|reply
[+] [-] ekm2|12 years ago|reply
[+] [-] papaf|12 years ago|reply
I think that using the Primer to learn programming would be a hellish experience but then learning C++ as a first language is never going to be fun.
[+] [-] bratsche|12 years ago|reply
[+] [-] unknown|12 years ago|reply
[deleted]
[+] [-] tbirdz|12 years ago|reply
[+] [-] nisa|12 years ago|reply
[+] [-] babbage141|12 years ago|reply
[+] [-] kasperset|12 years ago|reply
[+] [-] alexallain|12 years ago|reply
[+] [-] lukaszg|12 years ago|reply