|
I disagree.
You are implying that use of break and continue in the context of loops is improper coding.
In fact IMO it is quite the opposite.
Using break to exit a loop is both elegant and more "correct" than kludging the exit by artificially forcing the loop condition.
For example, exit from a "For Each..." loop is ugly without a break.
"continue" too is an excellent tool in limiting the scope of processing within a loop in an explicit and inexpensive manner.
These aren't merely shortcuts. They are useful directives which make code more readable and less ambiguous, and will improve performance over the alternatives.
Of course you can always code around the absence of these directives and we do, but in some cases scripts would be neater, shorter, faster and less inscrutable if we didn't have to.
I'll stop now, I'm beginning to repeat myself.
|