4 ms·
Hyrum’s Law applies, even when you take into account Hyrum’s Law. :) A story about a Golang program that had assumed map iteration was uniformly random but it’
by cpeterso 4y ago
Hyrum’s Law applies, even when you take into account Hyrum’s Law. :)
A story about a Golang program that had assumed map iteration was uniformly random but it’s not, which caused a load balancer to assign work unevenly:
https://dev.to/wallyqs/gos-map-iteration-order-is-not-that-random-mag https://dev.to/wallyqs/gos-map-iteration-order-is-not-that-r...
A graph of the map iteration order’s distribution showing that it’s not uniformly random:
https://twitter.com/cafxx/status/1135190309514620928 https://twitter.com/cafxx/status/1135190309514620928
- 0xjnml 4y agoFrom the language specification: "The iteration order over maps is not specified and is not guaranteed to be the same from one iteration to the next." There's a long shot between "not specified" and "uniformly random".
- pwdisswordfishc 4y agoThe joke is that the sort of people who rely on apparent behaviour in practice isn’t the sort that tends to look things up in specifications.
- akkartik 4y agoOk, you win, have a favorite.