Hacker News new | past | comments | ask | show | jobs | submit login

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-r...

A graph of the map iteration order’s distribution showing that it’s not uniformly random:

https://twitter.com/cafxx/status/1135190309514620928




From 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".


The 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.


Ok, you win, have a favorite.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: