91

Why are we using

for (int i = 0 ; i < count ; i++){ }

Why the i?

Why not

for (int a = 0; a < count; a++){ }

I do it, you do it, everyone does it, but WHY?

*Edit

I found out an old saying about Fortran which is more funny than correct which says "god is real, everything else above is an integer".

"god" would be a variable name stating with a g so it would be in the real domain, while everything else above (excluding h for the joke's purpose) would be an integer.

It seems that the original saying was in fact: "God is real, unless declared integer". Apologies to everyone citing me in their Ph.D thesis.

casperOne
  • 73,706
  • 19
  • 184
  • 253
Eric
  • 19,525
  • 19
  • 84
  • 147
  • 5
    Cf. the more active clone, [Why are variables “i” and “j” used for counters?](http://stackoverflow.com/questions/4137785/why-are-variables-i-and-j-used-for-counters-closed) – Charles Stewart Jan 27 '11 at 09:33

0 Answers0