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

Re: What does the short circuit || mean ?

by sundialsvc4 (Abbot)
on Mar 10, 2015 at 13:23 UTC ( [id://1119491]=note: print w/replies, xml ) Need Help??


in reply to What does the short circuit || mean ?

It is for all of these reasons (clarity, “falseness” gotchas) that I strongly prefer to see the plain-and-simple use of if or unless ... and, explicit relational operators.   If you are intending to make a decision or a branch here ... say that.   If you intend to test for a certain thing, say what you are intending to test for.   (And throw an exception if when “none of the above” actually happens.)

The computer will never mis-read your source code:   it will parse it, one way or another, and then it will do what it thinks you said.   But, people mis-read source code all the time, and that’s where a lot of head-banging (and, costly) project delays come from.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1119491]
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: (8)
As of 2024-03-28 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found