3 ms·
> I could easily change a C for loop to use i += 2 instead of i++ if I wanted, that's the beauty of it. If you're not doing something for each element of a col
by itishappy 1y ago
> I could easily change a C for loop to use i += 2 instead of i++ if I wanted, that's the beauty of it.
If you're not doing something for each element of a collection, you should not be using a `foreach` loop. In exchange for not exposing the implementation, you immediately know the behavior. You also don't have to worry about checking the rest of the loop body for later mutations.