3 ms·
Agree with most of this, but I think using "i" for the iteration index is ubiquitous enough that everyone knows it (or should learn it).
by llimos 5y ago
Agree with most of this, but I think using "i" for the iteration index is ubiquitous enough that everyone knows it (or should learn it).
- eterm 5y agoI agree provided the following: Is the iterator un-used within the body of the loop to do more than address a collection? If it is actually used, it suggests that it's representing more than just an iterator and should be named appropriately. If it isn't used within the body of the loop then it's purely for the sake of iterating across a collection (or just looping a given number of times) and should be named i.