Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: %hash (@array && use constant) in Modules

by Hrunting (Pilgrim)
on Apr 24, 2002 at 17:56 UTC ( [id://161695]=note: print w/replies, xml ) Need Help??


in reply to %hash (@array && use constant) in Modules

Everyone's comments are right. If you want to eek out every possible ounce of performance, arrays are faster, but for 99.99% of the jobs, hashes will do more than what you need, and they have other benefits in terms of object inheritance.

What I'm surprised no one has touched upon is:
Part of it is laziness: typing "[ ]" as opposed to "{ }", which requires a shift key.

Can you explain to me exactly how you're typing '[BAR]' without using the shift key? I suppose you could hit the caps lock key, but again, no decrease in the amount of work done.

As an aside, I did implement a class using pseudo-hashes (still use it in fact, very robust). While the whole idea may be very bad, it's worked out well for us. Our performance bottlenecks were elsewhere, though.

  • Comment on Re: %hash (@array && use constant) in Modules

Replies are listed 'Best First'.
Re: Re: %hash (@array && use constant) in Modules
by abaxaba (Hermit) on Apr 25, 2002 at 02:38 UTC
    I suppose, Hunter, that you are correct, regarding the shift keys. Typing BAR does require using shift. I was thinking more in terms of {bar} as opposed to [bar], I guess.

    Maybe I just hate typing curly brackets! :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2024-04-23 14:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found