Let's say you have a piece of code where you have a for-loop, followed by another for-loop and so on... now, which one is preferable
Give every counter variable the same name:
for (int i = 0; i < someBound; i++) { doSomething(); } for (int i = 0; i < anotherBound; i++) { doSomethingElse(); }
Give them different names:
for (int i = 0; i < someBound; i++) { doSomething(); } for (int j = 0; j < anotherBound; j++) { doSomethingElse(); }
I think the second one would be somewhat more readable, on the other hand I'd use j,k and so on to name inner loops... what do you think?