Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Useless unless

by jonadab (Parson)
on Aug 06, 2005 at 12:14 UTC ( [id://481475]=note: print w/replies, xml ) Need Help??


in reply to Useless unless

Am I the only one who uses unless in completely different circumstances from if not? To me, using unless implies that an exception to the rule is being given, an edge or corner case being handled; the protasis will *usually* be false, and so the apodosis will *usually* be carried out, but on the occasion that the protasis is true, then the apodosis is skipped. In other situations, when the protasis is likely to be true a lot, I use if not. I find this semantic distinction useful, in terms of making the code more legible when I come back to it later to make changes.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2024-04-24 03:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found