@Barns There are common idioms that all developers know and come to rely on. Those patterns make it easier for programmers to write and read code. When you deviate from those patterns by doing something "clever", as you do when you modify the loop control variable inside the loop, you increase the cognitive load, making the person reading or writing the code work harder to understand what it's doing. Adding another variable makes it clear that this isn't your standard
for
statement. In my career, I've found that clear code is much more reliable and easier to debug than clever code. —
Jim Mischel 32 secs ago