I believe the most used word in [spoken] English is “I”, and I am used to using i as a loop index.
Christian Clausen wrote:. . . the most used words in English . . .
Junilu Lacar wrote:Maybe i vs. indexToLoopOverArray is not the best example though. In that specific case, I doubt a newcomer (presumptuously speaking for newcomers here) would find the latter easier to read than the former. If it's just an index into an array, I'd bet that i is understandable enough
Junilu Lacar wrote:The key really is what Christian said: "brief vs descriptive." When you were first starting out, it hadn't sunk into your brain that the variable i in a for loop represents the index into whatever it is you're iterating over. After a while, you get it. That's when your brain has made the association between "i" and "index" and the use of the shorter version becomes more idiomatic to you, i.e., it has a special meaning. Before, it didn't and therefore, a more descriptive name would have helped you.