Naming convention (programming): Difference between revisions

Content deleted Content added
mNo edit summary
Multiple-word identifiers: removing the added section that exactly duplicates the previous section
Line 15:
 
An alternate approach, developed mostly as an alternative to the underscore in languages that do not permit hyphens, is to omit the space and indicate word boundaries using capitalization, thus rendering ''two words'' as either ''twoWords'' or ''TwoWords''. This is called [[CamelCase]], among other names.
 
There are several methods of writing multi-word identifier names in computer languages that tokenize on whitespace. For example, a variable called "my favorite variable" could be written as:
 
* myFavoriteVariable (lower camel case: [[Java programming language|Java]] variable and method names)
* MyFavoriteVariable (upper camel case: [[Java programming language|Java]] class names, [[C Sharp|C#]] method, variable and class names, [[Ruby programming language|Ruby]] class names)
* my_favorite_variable (underscored: [[Python programming language|Python]] method names, [[Ruby programming language|Ruby]] method names)
* My_Favorite_Variable (capitalization and underscores as used in [[Ada programming language|Ada]])
* my-favorite-variable (dashed: some [[Lisp]] functions)
* MY_FAVORITE_VARIABLE (all caps: constants in various languages)
* myfvvbl (with vowels removed: some [[C programming language|C]] functions and system calls)
 
== Information in identifiers ==