Why do most of us use 'i' as a loop counter variable?
- by kprobst
Has anyone thought about why so many of us repeat this same pattern using the same variable names?
for (int i = 0; i < foo; i++) {
// ...
}
It seems most code I've ever looked at uses i, j, k and so on as iteration variables.
I suppose I picked that up from somewhere, but I wonder why this is so prevalent in software development. Is it something we all picked up from C or something like that?
Just an itch I've had for a while in the back of my head.