Advantages of While over Goto
The advantages of "While @True" over GOTO...
- It tells you the instant you see it that this is an infinite loop. With GOTO you won't know that until you reach
the end of the loop and see the goto statement. And if it's a very long loop, it might not be obvious even then. So
"While @True" results in cleaner, more maintainable code.
- A while loop allows you to use BREAK and CONTINUE. With GOTO you'd have to use more GOTOs, and it you wouldn't
know if those GOTOs were breaking, or continuing, or just flying off in a random direction, until you searched
through the code to find their destinations. Again: While @True results in cleaner, more maintainable code.
Article ID: W17885
Filename: Advantages of While over Goto.txt
File Created: 2008:11:25:12:09:28
Last Updated: 2008:11:25:12:09:28