Languages/All/IdentifierNames

From UIT
Revision as of 12:01, 2 December 2015 by Oliver.gubler (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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