Languages/All/IdentifierNames
From UIT
Revision as of 13:01, 2 December 2015 by Oliver.gubler (Talk | contribs)
|
Identifiers
Here are some tips for choosing good identifiers.
... 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); }