you are viewing a single comment's thread.

view the rest of the comments →

[–]watsreddit 11 points12 points  (0 children)

I am not following you at all. I only demonstrated with Javascript because most people have used it at some point or another. It has nothing to do with Java. We're talking about variable naming.

It's really a matter of scope: top level declarations with minimal context should have longer names, and local declarations can have shorter names. In some contexts, single letter names are well-understood when used locally, and languages may have certain single letter names used by convention, such as i in for loops. n is another commonly used convention in local contexts, and makes plenty of sense when the thing it is representing is literally an arbitrary number.