Languages/All/IdentifierNames

From UIT
Jump to: navigation, search

Contents

Identifiers

Here are some tips for choosing good identifiers.

Dialog-warning.png

... the length of a variable's name SHOULD be proportional to the size of its scope, and the complexity of its use.

Example

// Bad idea :
for (int RidiculouslyLongIdentifierName = 0 ; RidiculouslyLongIdentifierName < 0 ; RidiculouslyLongIdentifierName++)
{
	System.out.println(RidiculouslyLongIdentifierName);
}
 
// Better :
for (int i = 0 ; i < 0 ; i++)
{
	System.out.println(i);
}
Personal tools
Namespaces
Variants
Actions
Navigation
Browse
Toolbox