As far as variable naming conventions go, should iterators be named i or something more semantic like count? If you don’t use i, why not? If you feel that i is acceptable, are there cases of iteration where it shouldn’t be used?
As far as variable naming conventions go, should iterators be named i or something
Share
Depends on the context I suppose. If you where looping through a set of Objects in some collection then it should be fairly obvious from the context what you are doing.
However if it is not immediately clear from the context what it is you are doing, or if you are making modifications to the index you should use a variable name that is more indicative of the usage.