Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: flattening Complex Datastructures

by FoxtrotUniform (Prior)
on Feb 10, 2003 at 19:07 UTC ( #234205=note: print w/ replies, xml ) Need Help??


in reply to flattening Complex Datastructures

Another issue I can see with this approach is that it's not terribly obvious. Not that one should write nothing but pedestrian code -- if this is the right thing to do, then do it -- but I can easily imagine some poor maintenance programmer looking at this code and thinking "WTF? Why didn't he just use a HoH?"

Another point: specific operations will be O(1) instead of O(depth) if you know exactly where you want to go (i.e. you have a hash key already), but building the key may be O(depth), depending on how much information you have ahead of time. (And if speed's your concern, you can always snap the reference the first time you need it.)

In general, I'm not sure that this technique gives you much of a win, but I'm not clever enough to prove that it'll never be useful. :-) Nice job, and thanks for making me think.

--
F o x t r o t U n i f o r m
Found a typo in this node? /msg me
The hell with paco, vote for Erudil!


Comment on Re: flattening Complex Datastructures

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2014-12-22 07:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (112 votes), past polls