←back to thread

1371 points yett | 1 comments | | HN request time: 0.223s | source
Show context
amenghra ◴[] No.43774928[source]
IMHO, if something isn’t part of the contract, it should be randomized. Eg if iteration order of maps isn’t guaranteed in your language, then your language should go out of its way to randomize it. Otherwise, you end up with brittle code: code that works fine until it doesn’t.
replies(11): >>43774993 #>>43775199 #>>43775210 #>>43775344 #>>43775361 #>>43775510 #>>43775759 #>>43776084 #>>43776311 #>>43776598 #>>43778608 #
willcipriano ◴[] No.43775510[source]
Then you are wasting runtime clock cycles randomizing lists.
replies(3): >>43775920 #>>43776036 #>>43779041 #
1. Cthulhu_ ◴[] No.43776036[source]
Not necessarily; you can do a thing where it's randomized during development, testing and fuzzing but not in production builds or benchmarks so that the obvious "I rely on internal map order" bugs are spotted right away.