CSC/ECE 517 Summer 2008/wiki2 2 ao

From Expertiza_Wiki
Jump to navigation Jump to search

Variable, Class, and Module Naming

When programming, choosing appropriate names for variables, classes, modules, etc. can often be taken too lightly. It's always important to choose descriptive names with straightforward meanings. Certain conventions should be followed to ensure code can be read, followed, and edited easily.

Common conventions

  • Lowercase letters should be used for variable and method names. A name consisting of several words should be concatenated into one word (take out the spaces). The first word should be all lowercase, and each subsequent word should have its first letter capitalized.
  • Class names should have the first letter of each word capitalized. Multi-worded names should follow the rule above, except that the first word should also be capitalized.
  • Contants should have every letter capitalized, with underscores between words.

References

External Links