Re:Is there an excuse for short variable names?
by NateDad on Saturday February 02, 2013 @05:35PM
(#5157664)
Variable length should be comparable to the length they're in scope and their importance. So short indices for loops is fine. S for a string in a loop over a list of strings is fine (so long as the loop isn't too long).
Assuming everyone knows your equation and what your variables mean is a terrible idea. Unless your method is less than 10 lines and you explain all the variables in a comment... just write stuff out. Text is free. Don't go crazy, but 4-8 characters won't kill anyone and may well prevent bugs.
Assuming everyone knows your equation and what your variables mean is a terrible idea. Unless your method is less than 10 lines and you explain all the variables in a comment... just write stuff out. Text is free. Don't go crazy, but 4-8 characters won't kill anyone and may well prevent bugs.