Beefy Boxes and Bandwidth Generously Provided by pair Networks Joe
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re (tilly) 5: mapcar -- map for more than one list

by tilly (Archbishop)
on Jan 22, 2002 at 04:22 UTC ( #140542=note: print w/ replies, xml ) Need Help??


in reply to (tye)Re4: mapcar -- map for more than one list
in thread mapcar -- map for more than one list

Suppose that you are trying to figure out what happened last night in a production run. Then no matter how clearly the intention read when you wrote it, the question that you are trying to answer is, "Did it do this?" Which usually looks like, "OK, I should have had X, Y, and Z, do I enter this block?" And in that situation, unless is an extra "no" from the question you are trying to figure out.

Even if I want to factor out a no, I will write it explicitly as an if. Seeing the no written explicitly simplifies a complex expression for me just enough to turn potential confusion into understanding.

I know it sounds silly, I know it sounds stupid. It did to me when I first heard this tip from another programmer. But after I was bitten a couple of times, I learned that it was true. On complex expressions, the implied not in unless is a nasty debugging trap waiting to happen.


Comment on Re (tilly) 5: mapcar -- map for more than one list

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2014-04-17 22:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (458 votes), past polls