Take the 2-minute tour ×  When programming, what naming
conventions do you use for your variables? I don't mean when the
name of the variable should be obvious; ie. sum, total, first,
last. But when you name variables that don't really fit into a
category/obvious structure, what sort of names do you use? Is
it, myVar1 or test1 or variable1, etc...?  share|improve this
question add comment  closed as not constructive by Walter,
gnat, ChrisF Aug 2 '12 at 17:03   6 Answers  up vote 20 down
vote accepted  There always must be a purpose for a variable,
otherwise you can leave it out and you don't need a name. So use
it's name to identify the purpose for a variable.  e.g. I
sometimes introduce variables for the sole purpose of keeping a
value that needs to be returned. I might call that variable
returnValue e.g. sometimes it is a temporary for a different
variable, I might use tempUserName  hope this helps.
share|improve this answer +1: The only variables that don't need
a name are i for tight loops, and even then