True, that part&#x27;s still a potential problem.  I often avoid it with something like this (which I believe is more clear anyway).<p><pre><code>   i = arraylength;
   while (i-- &gt; 0)
</code></pre>
In other cases it really does make more sense to count up.  Another unconsidered possibility is that the &quot;found&quot; case might actually <i>return</i> from an iterator function, so you can put the &quot;not found&quot; case after the loop regardless of which way you&#x27;re counting.<p>The &quot;counting down can cause an infinite loop&quot; problem does exist, but I&#x27;ve also seen cases where counting up can fail too (e.g. index incremented twice within a loop either accidentally or deliberately), or where confusion of whether to use &quot;i&quot; or &quot;i-1&quot; caused bugs.  It&#x27;s probably even easier for a static analyzer to catch a counting-down bug than a counting-up bug, so I&#x27;m not really sure that a preference for counting up is all that helpful.