Survival Rules for Newbies
First Rule : If have no interest in investigating the nuances of a complex language, then you should not choose C++ .

C++ is harder to master than interpreted languages. However, it can offer a good amount of syntax sugar without significant runtime penalty. In the object oriented paradigm, C++ is even faster than fortran 2003! Interpreted languages also require the use of external libraries that are not mature. Calls to mainstream libraries, like GSL and NAG, require wrappers in interpred language and that may introduce addtional bugs to your code.
Second Rule : If you want to learn C++, follow google style strictly until you master their forbidden rules .

Don't rush and be simple. Exceptions and RAII, for example, are powerful techniques to manage memory allocated by C libraries. However, they can also cause serious problems if used inappropriate. It takes time and effort to master the advanced features.
Third Rule : If you are self confident about your C++ skills, you probably overestimate your C++ understanding .

C++ is hard. You must think carefully before inserting a particular aspect of the language in your program. That is why development teams tend to limit the number of C++ features that are allowed on their projects.
Fourth Rule : Choose carefully the numerical libraries you use in your program .

Python libraries, for example, tend to use numerical libraries that are far from being mature. Decades of work are necessary to develop reliable packages. For example, GSL is available for more than 10 years, but you can still check the existence of recently fixed dangerous bugs. All the mainstream libraries I am aware of are written in C with few exceptions like Armadillo. Unlike interpreted languages, C++ can call C functions without the need of a wrapper.
Fifth Rule : Avoid writing heavy numerical work in C++ .

Between C++ and interpreted languages, it is safer to write numerical kernels in C++. C++ is also safer than C because it has stricter type safety rules. Even though I share this belief, I use C in heavy tasks for optimization. In practice, it is good enough to delegate the heavy numerical work to GSL and NAG libraries. This advice is especially important if you use Numerical Recipes because I strongly believe that NR C++ version is not worth the potential performance hit.
Sixth Rule : Don't blindly trust C++ wrappers .

Wrappers can be quite dangerous. With simple tricks, it is possible to call C libraries without losing most of the syntax sugar that C++ can offer. One example of a wrapper I don't trust is the official CFITSIO C++ wrapper. Its implementation seems to be heavily based on std::valarray and std::auto_ptr. The smart pointer std::auto_ptr is deprecated and std::valarray team left the standard committee more than a decade ago. Another example: GSL wrappers probably use static functions and manage themselves the allocation of memory, and this can make your code to not be thread-safe.
Seventh Rule : Always use the pointer "this" when you refer to member variables or member functions .

Remember: people don't know about your particular naming convention. Once at work, my collegue, who is a C programmer, had difficulty in locating my member variables definitions. The use of the pointer "this" helps them to identify that a particular variable is owned by a class.
Eighth Rule : If you have a piece of code that can be easily generalized, implement it as a global function .

When we learn C++, our first impulse is to write everything inside member functions. They are, however, tied to a particular class, and if another class needs similar behavior, you will have to duplicate code unnecessarily. Smaller code are easier to update, maintain and debug.
Useful references
Google C++ Style
List of Books I highly recommend
My favorite reference website for definitions
My favorite reference for common issues (be careful about copyright if you copy pieces of code from this website)
Runtime memory/cache debugger
Articles arguing that expression templates is not the optimal technique for matrix multiplication
Smart Expression Template.
Only a wrapper to low level libraries. Fix expression templates.
Armadillo C++ Linear Algebra Library.
The most famous linear algebra library in C++.
Non commercial free license of intel C++ compiler.
Useful pieces of code
Wrapper to GSL Functions.
Code that read input files
Wrapper to GSL interpolation routines
Deleter Class. Allows smart pointers to manage GSL memory.
Wrapper to GSL 1D Find Root routines
Generic C++ Makefile
Libraries I frequently use
More general good libraries
Libraries that allows you to create GUI
Home