home > resources > c++ coding standard > online version

Initialize all Variables

You shall always initialize variables. Always. Every time.

Justification

  • More problems than you can imagine are eventually traced back to a pointer or variable that was left uninitialized. C++ tends to encourage this behaviour by propagating the initialization to the constructors of the parent classes.