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

Method Names

  • Use upper case letters as word separators, lower case for the rest of a word
  • First character in a name is lower case
  • No underbars ('_')

Justification

  • Differentiates the first word part, which is often a verb. This makes it very clear what a method does.
  • Not exactly similar to class names and thus makes Class.doSomething() much more readable as Class.DoSomething(), cleanly indicating through case which is which.

Example 2-3. Method Names Example

class NameOneTwo
{
public:
    int     doIt();
    void    handleError();
}