Cpp Coding Standards/FIMPL

From Apache OpenOffice Wiki
< Cpp Coding Standards
Revision as of 15:24, 27 November 2006 by Np (Talk | contribs)

Jump to: navigation, search

Function Implementation

Issues when implementing function bodies.


Rules

ShortFunctions

Make functions short.

Consider replacing comments by function calls. Consider to flatten deep nested control structures by moving parts of them in extra functions. Consider moving complicated loop bodies into extra functions. Put repeated code snippets in an extra function.

NoMagicNumbers

Don't use unnamed constants in your code. Give them a descriptive name.

SwitchDefault

Don't just drop out of a switch statement, always provide a default case or a comment, why it is not needed.

Comment missing breaks.

NoCatchAll

Avoid catch(...).


Related Rules


Personal tools