Naming Rules
Last updated
Last updated
Names shouldn't be too long. If they come out to be huge, use an appropriate acronym, or more preferably, find a way to make it shorter. If you can't make it shorter and keep the original meaning, comment its actual purpose.
BAD:
GOOD:
And less preferable:
Abbreviations should not be used, except for a few special cases. They are as following:
Other approved abbreviations are those that are very commonly used, like DNS for Dynamic Name Service, HTTP for HyperText Transfer Protocol, XML for eXtensible Markup Language, JSON for JavaScript Object Notation, etc.
EXCEPTION: if you are writing a simple for
loop, i
, j
, x
, y
, and z
are acceptable iterator names. When writing complex algorithms which may involve nested loops, or loops whose iterator isn't so obvious, pertain to using more descriptive iterator names.
Name
Abbreviation
Interator
Iter
Implementation
Impl
Variable
Var
Function
Func
Number
Num
Constant
Const
Utility
Util
Argument
Arg
Parameter
Param