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

Re: An irrational coding choice found

by JavaFan (Canon)
on Mar 19, 2012 at 00:46 UTC ( #960351=note: print w/replies, xml ) Need Help??


in reply to An irrational coding choice found

I need a new approach to breaking me of this bad habit.
I bet that in the majority of your cases, it doesn't make any difference on whether you're using a hash or an array. Unless this access is 1) a bottleneck, 2) the current performance is unacceptable, and 3) changing it to an array makes the performance acceptable, then you've made the wrong choice.

Otherwise, it isn't worth fretting about.

Replies are listed 'Best First'.
Re^2: An irrational coding choice found
by Anonymous Monk on Mar 20, 2012 at 15:15 UTC

    I concur; there is value to be had from learning *how* to get that last little squinch of performance out of a bit of code, but the actual doing-so should be saved for when you need it.

    The choice of an array-vs-hash for me frequently comes down to readability for myself and my teammates--someone else who isn't as skilled with Perl as I am will have to read this, so it needs to make sense. For the way we work, that usually means "hashes."

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://960351]
help
Chatterbox?
[choroba]: Will Glasgow have been out of the EU by that time already?
[LanX]: nope
hippo might venture to YAPC::EU.
[choroba]: YAPC::YAEC (yet another European country)
[LanX]: they are proposing an infinite transition phase now ...
[choroba]: infinite transition implies infinite money!
[LanX]: ... ehm ..."open ended" ;-)

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2018-02-23 10:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When it is dark outside I am happiest to see ...














    Results (301 votes). Check out past polls.

    Notices?