I was assigned to work on an Android-Java (real-time game) project with a considerable (partially legacy) code base.
Most of the loops I see are like this (where mjk
I believe that this was just an inexperienced programmer. In general, it's of course always better to use a <
for more robustness. In the case of fooling around with the index (e.g. by changing the step interval to i+=2
), it will not produce an infinite loop.
Technically, comparison might use less CPU time (not so familiar with this though), but the effect is marginal or just irrelevant, it will not destroy any program's performance... :)