Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: Re: Idiomatic optimizations

by Juerd (Abbot)
on May 01, 2002 at 16:44 UTC ( #163298=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Idiomatic optimizations
in thread Idiomatic optimizations

$i?$i=1:$i=0;

Puh-lease, use some whitespace! Here are some alternatives:

$i ? $i = 1 : $i = 0; $i = $i ? 1 : 0; $i = !!$i || 0; $foo = $foo ? 1 : 0; # Single-letter variable names: # easy to type, hard to read

Always pass referances not data structures

Most references are the root of data structures, so I think you meant "Always pass references instead of flattened hashes or lists". Note that you can't use this if the sub in question doesn't expect it.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://163298]
help
Chatterbox?
[stevieb]: hmmm seems the ionic.zip C# library doesn't work right on win10. With berrybrew, only part of the perl portable zip is extracted. no errors nothing. Guess I have to look at switching out zip libraries. sigh

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (9)
As of 2017-03-28 16:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (335 votes). Check out past polls.