Here it goes:
- C++ is not C. Stop mixing C and C++ unless it is required. Start thinking in C++.
- Have a C++ coding standard defined or follow the coding standard defined for your project or organization.
- Design from outside, design the interfaces first.
- Avoid using assignments in constructors, use initializer list to initialize members.
- Know the need of copy constructor and define when needed.
- Use virtual destructor when your class is used as a base class.
- Never call a destructor (unless you're using a placement new). If you do, you may need to revise your software design.
- Avoid using placement new.
- Avoid using Macros for functions. Use Inline functions instead.
- Avoid using Array, unless you have to. Use standard library containers like Vector, etc.
- Avoid C style cast, use the C++ casts.
- Use references when you can and pointers when you have to.
- Use composition when you can and private inheritance when you have to.
- Use const for function parameters when you can.
- Be careful about static initializations, you might get unexpected behavior if the static variables/objects has dependencies.
- Be careful about multiple inheritance. Understand the 'dreaded diamond'.
- Be careful about floats and doubles. They may give you unexpected behaviors.
- Avoid constant literals in the code. Separate them in static inline functions or macros.
Once you get used to all of the suggested points, you'll find that your code is much much better than many others and of course, more optimized and less error prone. Let me emphasize, 'these are golden suggestions, try to follow them'.
Happy coding :).