laziness, impatience, and hubris | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
About how I use conditionals? In perl I mostly use and and or for conditionals much more often than if and unless. I never use prefix unless. I very rarely use postfix unless, only in cases when the condition almost always holds, like print ", " unless $index==$length-1; I use prefix if for conditionals that have both a then and an else (or elsif) branch. I sometimes use prefix if for other conditionals randomly, especially when there is no action done in the condition. I sometimes use postfix if in similar cases, when the condition is not very important. But for most conditionals, I just use and, or, or with multiple statements and do {, or do {. That is good because it places emphasis on the condition. This is only my coding style in perl, it's of course different in other languages as their conditional constructs are different too. In reply to Re: A new idiom -or- I Hate Unless
by ambrus
|
|