4 ms·
I like it. If you're not going to have guaranteed order, then explicitly breaking it to avoid accidental dependency that will break your programs later when th
by dilap 11y ago
I like it.
If you're not going to have guaranteed order, then explicitly breaking it to avoid accidental dependency that will break your programs later when the language implementation changes is very much a good thing.
Compare this to python, which has deterministic dictionary order, but it changes across implementations. That's just begging for problems.
I think the whole philosophy of Go is kind of "try to avoid shit breaking in weird and unexpected a mysterious ways", an approach I become more sympathetic to the longer I program.
- pcwalton 11y agoIs there any advantage to randomizing on every iteration over just randomizing a single seed at process startup? Generating one seed at startup would solve the problem of accidental de facto stabilization of dictionary iteration order while avoiding the issues mentioned in the parent comment.
- dilap 11y agoThat does seem more reasonable, actually, unless there's some crazy reason you might actually want to vary the order w/in a single process lifetime I'm overlooking...
- deleted 11y ago[deleted]