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
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
Found a typo in this node? /msg me
The hell with paco, vote for Erudil!