Totally agreed, but in this case if the author had declared the variable in the for-loop:<p><pre><code>  for(int y=0; y &lt; ymax; y++) 
     ...
</code></pre>
and didn&#x27;t shadow y from an enclosing scope, that would have given the compiler a chance to catch that error.