Learning C++ on your own?

I also used the Stroustrup book (the beginner one, Principles and Practices using C++, not The C++ Programming Language which is very much not for beginners) to learn C++. It was a good book that taught a lot of important things that were merely glossed over in class, but I needed two other things before I started to actually get the hang of using it properly:

  1. A class in Java on OOP programming. This taught me to use a structured approach to designing code, and to use data structures. Very useful and a difficult, though far from impossible, skill to learn on your own.
  2. Actual coding in C++ in a professional environment (work and research). Visual Studio is an extremely advanced tool that takes years to properly understand, and it makes your life a lot easier.

Stroustrup is a very good book, written by the person who actually invented C++ and understands what it is meant to do. His coding methodology is very sound and very useful. It was more useful than any class I took on the actual subject of coding in C++, but there are many details from his book you will not appreciate until you are taught to use it in a class setting.

To really understand what C++ can do at a high level, you probably need a Masters in CS. There is a lot to it, more than anyone would think without having the proper CS background. For physics/math/engineering, you don’t need to know C++ in that depth, but you do need to know how to write computationally efficient code in a good style (because high-performance computing is what you’ll really be doing). Those majors tend not to write significant amounts of code, but rather just use straightforward coding tools when they are necessary (usually Matlab/Python/Mathematica would suffice, but C/C++ are for high-performance applications). For that application, I’d say the following are necessary:

  1. Basic foundations of C++ (Stroustrup will more than suffice)
  2. A class on structured programming in OOP, along with data structures (tough to learn from a book)
  3. Algorithms (Might be able to get by without it, but not recommended. Very hard to appreciate without a good teacher)
  4. Numerical analysis (Probably want one heavy on theory. Good free book: http://www.mathworks.com/moler/chapters.html)
  5. Scientific computing (Might want a class, but it's pretty high level and you will have significant prereqs).

All in all: there are things you can learn from a book, and I definitely recommend Stroustrup. But you won’t get everything you need by self-study. If you want to have a solid foundation in using code for the purposes of physics/math/engineering, you need to put in a strong effort over the course of a few years. And since it is a very important skill that is becoming more and more important over the years, you would be well-advised to put in the effort to learn it properly.