←back to thread

1371 points yett | 6 comments | | HN request time: 0.868s | source | bottom
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 #
1. frollogaston ◴[] No.43776311[source]
Randomization at this level would be too expensive. There are tools that do this for debug purposes, and your stuff runs a lot slower in that mode.
replies(2): >>43776596 #>>43778874 #
2. foxhill ◴[] No.43776596[source]
it probably shouldn’t be a “release” thing. actually, certainly. i do wonder how many bugs would never have seen the light of day, if someone’s “set” actually turned out to be a sequence (i.e. allowed duplicate values) resulting in a debug build raising an assert.
replies(1): >>43778199 #
3. Arainach ◴[] No.43778199[source]
Debug builds are worthless for catching issues. How many people actually run them? Perhaps developers run debug builds of individual binaries they're working on when they're trying to repro a bug, but my experience at every company of every size and position in the stack (including the Windows team) is that no one does their general purpose use on a debug build.
replies(2): >>43778618 #>>43784699 #
4. dontlaugh ◴[] No.43778618{3}[source]
Especially in games, it’s common for only the highly optimised release builds to have playable performance.
5. throwaway2037 ◴[] No.43778874[source]
I had to Google to find the tid bit that I read about Perl years ago. I think this will affect iteration order of dicts.

    > Nov 22, 2012 — Perl 5.18 will introduce per process hash randomization and almost certainly will feature a new hash function.
6. frollogaston ◴[] No.43784699{3}[source]
Yeah, even their integration tests will probably run in opt mode.