Last question for today all...I will get back with tomorrow..I have a lot to follow up on...
I am looking in Reilly Java text- talking about counter controlled loop patterns..(does not matter what language..)
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..
Examples:
x = 0;
while (x != 100) {
y = 0;
while (y != 100) {
...
y++;
}
x++;
}
Would it be better to just say..using the other relational operators...
x = 0;
while (x < 100) { //or even better some defined constant...
y = 0;
while (y < 100) {
...
y++;
}
x++;
}
Which from what I have seen is usually the way presented in texts..classes.etc..
Once again- would all you considered this bad- or just a different way of doing it... Thanks...