(!) 04.01: Never leave pointers uninitialized.
(!) 04.02: Never allow dangling pointers. If objects are destroyed or invalidated, all pointers to it must be cleared.
(!) 04.03: Use NULL for null pointers, not the numerical value 0.
(!) 04.04: Always initialize variables at declaration.
(!) 04.05: Provide a virtual destructor if a class contains virtual methods.
(!) 04.06: Define typedef and enumerated types in an appropriate class scope to avoid name space conflicts/pollution.
(!) 04.07: Keep the scope of objects as small as possible.
(!) 04.08: Use "#pragma once" in header files to avoid duplicate inclusion.
(!) 04.09: Initialize all member variables in the constructor.
(+) 04.10: If the initializer list is used in a constructor, initialize members in the correct order.
(+) 04.11: Consider use of exception handling to catch runtime errors.
(+) 04.12: Be careful with public member variables. Consider using get/set methods instead.
(+) 04.13: Use minimal and appropriate types.
(+) 04.14: Use references instead of pointers whenever possible.
(+) 04.15: "Maximum const" philosophy: Use as much const qualifiers as possible to avoid unintentional changes.
(+) 04.16: Use "const" constants instead of #define. Defines tend to conflict with other peoples defines and are not type safe.
(+) 04.17: Use inline functions instead of macros. Macros are difficult to debug and often suffer from different semantics in the pre-processors.
(+) 04.18: Put all code into .cpp file. No code in include files, except for short inline and template code.
(+) 04.19: One class per source and include file.
(+) 04.20: Append a newline at the end of your files to avoid compiler warnings.
(+) 04.21: Switch statements should always have a default case, if not all cases are handled explicitly.
© 2024 MeVis Medical Solutions AG