Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Perl style question: loops with postcondition

by Zaxo (Archbishop)
on Jun 28, 2002 at 10:20 UTC ( [id://177982]=note: print w/replies, xml ) Need Help??


in reply to Perl style question: loops with postcondition

Choose the form which fits the situation, and makes linguistic sense. It's not a popularity contest.

do () while $condition; suggests the condition is temporary and that the bracketed code labors to make it go away.

while (1) { {}; last unless $condition} reads as if the loop is the thing, and that failure of $condition is exceptional.

LOOP:{ {}; goto LOOP if $condition} shouts "I don't care what anybody thinks, I'm looping!" ;-)

There are many WTDI you omitted, and different programmers will say thinngs differently. TIMTOWTDI, but also DSFDF.

After Compline,
Zaxo

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://177982]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2024-04-25 03:56 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found