Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

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!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://234205]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2017-02-25 02:59 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (365 votes). Check out past polls.