http://qs321.pair.com?node_id=367116


in reply to until loops

I usually find it a little cleaner to say
until($year >= 2000)
That is to say continue until year is greater than or equal to 2000. In case you go back and change your code within the loop and do something more complicated than increment.

Unless you really mean that only 2000 is an escape loop case and 2001 and up will be continue loop cases.

Replies are listed 'Best First'.
Re^2: until loops
by apotheon (Deacon) on Oct 11, 2004 at 00:05 UTC
    On the other hand, with only the == instead of >=, it's a perfectly appropriate demonstration of the concept. I'm not sure, but if compiled, the == might actually execute faster than the >=, though by such a minute margin that it's effectively useless to differentiate.

    - apotheon
    CopyWrite Chad Perrin