Ask HN: What's the best way to start with C++?
Hey HN, I've been programming for about 10 years now and I decided that it's finally time. I've always wanted to learn C and C++ but never got around to it.
I've worked in Java, C#, Ruby, Python, JavaScript, the usual suspects on the web. So I'm happy to invest time in learning a language.
My main question is two-fold: * what are the best resources (books, tutorials) out there? * if you are currently working in C++, what do I absolutely have to know that might not be obvious?
Thanks so much!
4 comments
[ 0.25 ms ] story [ 15.4 ms ] thread2) Memory management is the biggest difference from Java and C#. Try not to use pointers unless you have to, when you do try to anchor the pointers in stack data (created without new), if you have to use new try to wrap the pointers in RAII classes (smart pointers).
3) C++ is multiparadigm, don't feel required to stick religiously to OOP practices. functional and procedural techniques can be better if you know what you're doing.
4) The stl isn't as... robust as the standard libraries of other languages. You WILL need to search for third party libaries.
And for the language itself, cprogramming (http://www.cprogramming.com) is a really good aid for the latest concepts like auto and decltype
As an aside, TDD and refactoring also aren't as mature in C++ (vs Java, C# and Javascript).
- Accelerated C++: Practical Programming. A good quick tour of C++98
- Effective C++, More Effective C++,Exceptional C++, C++ Coding Standard
Many patterns to follow or be aware of. More generally, any book by Herb Sutter.
Good recent books (msut have !!):
- Effective Modern C++ (same as previous, but more focused on C++11 and 14)
- Programming: Principles and Practice Using C++ (A general introduction book by Stroustrup on programming using C++)
- C++ Primer (The spiriual son of Accelerated C++, the best introduction book about C++ I know)
The textbook and more specific books :
- The C++ Programming Language (the ultimate C++ textbook)
- C++ Template the complete Guide (focused on templates)
- C++ Concurrency in Action (focused on threading)
In a second time, have also a look at some libraries like boost (many specific purpose components), Qt (huge framework for making GUI), Poco.
- Website https://isocpp.org/ (the official website for the language).
- Have a look at usenet (comp.lang.c++ and comp.lang.c++.moderated), CppCon's videos, Meeting C++ videos and Channel 9