Using != with counter controlled loops
<p>Last question for today all...I will get back with tomorrow..I have a lot to follow up on...</p>

<p>I am looking in Reilly Java text- talking about counter controlled loop patterns..(does not matter what language..)</p>

<p>The author for counter controlled loops (for, while, etc) and with nesting loops...uses the != for test...Now I realize != is used for certain situations with event controlled loops-like sentinel or EOF type of loops- but to me- using it with a counter controlled loop is a bad idea...very prone to errors..</p>

<p>Examples:</p>

<pre><code>x = 0;
while (x != 100) {
   y = 0;
  while (y != 100) {

   ...
   y++;
 }
  x++;
}
</code></pre>

<p>Would it be better to just say..using the other relational operators...</p>

<pre><code>x = 0;
while (x &lt; 100) {   //or even better some defined constant...
   y = 0;
  while (y &lt; 100) {

   ...
   y++;
 }
  x++;
}
</code></pre>

<p>Which from what I have seen is usually the way presented in texts..classes.etc.. </p>

<p>Once again- would all you considered this bad- or just a different way of doing it...
Thanks...</p>
