top | item 45807646

(no title)

not_kurt_godel | 3 months ago

I'd love to see the results of mandating a random order dict impl at an actual company/org (but hate to be forced to participate). Hopefully you hired developers who really like to write sorting algos.

discuss

order

yxhuvud|3 months ago

Well, that is how hash tables in go works, so you'd not have to look that far.

tasty_freeze|3 months ago

Perl since 5.8.something has had the option of perturbing the hash function, so it is different from run to run. You can also set the set to a given value in order to lock in the sequence.

In any case, it is not ordered. If you want that, you have to explicitly sort the keys of the hash.

not_kurt_godel|3 months ago

Great. Maybe GP will go a step farther and also mandate arrays that return elements in random order too. Relying on insertion order for any reason is for weaklings.