Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: What did you have to Unlearn

by dws (Chancellor)
on Jun 08, 2001 at 21:16 UTC ( #86987=note: print w/replies, xml ) Need Help??


in reply to What did you have to Unlearn

I had to unlearn a pattern of thinking that put conditionals first. Code like
if ( $DEBUG ) { print "debug info\n"; }
use to fly off of my fingertips without much thought. It took a while to try writing   print "debug info\n" if $DEBUG;
Once I saw that this could lead to less cluttered, easier-to-read code, the change was easy. Using "unless" took a while longer, since I balked at the built-in negation. I use it sparingly, for things like   unlink $file or die "$file: $!" unless $DEBUG;

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2019-12-13 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?