CSC/ECE 517 Summer 2008/wiki2 2 ao: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
Line 19: Line 19:
* http://www.kamath.com/columns/squareone/so001_whatname1.asp
* http://www.kamath.com/columns/squareone/so001_whatname1.asp
* http://java.sun.com/docs/books/tutorial/java/nutsandbolts/variables.html
* http://java.sun.com/docs/books/tutorial/java/nutsandbolts/variables.html
* http://www.erlang.se/doc/programming_rules.shtml

Revision as of 18:42, 25 June 2008

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