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
|
---|