Computer Science Programming Standard

Naming Conventions

Classes

In general class names should reflect the general purpose nature of the class. Good names are often nouns which best express the abstract features of the class.

Examples

Good Class Names Bad Class Names

Variables

Like class names, variables are usually nouns which are descriptive of the type of data that they store. However, unlike class names, variables should be more specific to be more clear as to the purpose of the variable.

Examples

Good Variable Names Bad Variable Names

Methods

Unlike classes or variable names, method names should be active verbs which concisely and accurately express the purpose of the method. In fact if you find yourself having trouble accurately naming your method than it is a good indication that your method does too much work and should be broken into two or more smaller methods.

Examples

Good Method Names Bad Method Names