After writing so many for loop, I could not find to name iterator. I want write meaningful iterator’ name, can you help me ?
ex ;
- i
- j
- ii
- jj
- iii
-
jjj
usage :
for i = 0 ; i < …
for j = 0 j < …
Finding new iterator name makes my life a bit miserable. How do you find name to your iterator ?
Then the name you use should reflect the meaning of what the iterator is used for.
For example if you are looping over products inside a loop of categories inside a loop of catgegory-groups, you might use names like
producti,categoryi,groupi, perhaps together with number-of-item names likesproductn/categoryn/groupnand/or array names likeproducts/categories/groups.I’d only use
ifor the simplest short non-nested loops that one can understand with a quick glance. Personally I wouldn’t even usej; when loops are nested that usually calls for more self-explanatory variable names.