From: Ben Johnson Date: 2008-10-03T14:05:32+09:00 Subject: Re: Ordered hash hack for < ruby 1.9? Erik Hollensbe wrote: > There are a number of recommended packages already that should do this, > use one of them.. Not to mention this monkeypatch is going to slow down > your whole program, when you likely just need it in one or two spots. > > If you do have to code it yourself, consider using the 'delegate' > library (in stdlib) to wrap your specific, non-standard logic into its > own class, where it can be managed separately from standard hashes. > > Yours in preventing senseless monkeypatching, > > -Erik Thanks Erik, I agree 100%. I ONLY applied this when testing, where performance really isn't an issue. I just needed hashes to iterate in a consistent order. What was unique about my situation is that the hash order didn't matter to the functional purpose of the method. It mattered only when I needed to do assertions in my tests. Honestly, if order if meaningful you should use an array. I think any of the above gems are not the best choice when it comes to performance. -- Posted via http://www.ruby-forum.com/.