4 ms·
A closely related thing: If you're designing a programming language implementation, explicitly randomizing implementation-defined operations makes a whole lot
by TheLoneWolfling 12y ago
A closely related thing:
If you're designing a programming language implementation, explicitly randomizing implementation-defined operations makes a whole lot of sense. It trades dev time for debug time, and in general fixing bugs during initial development is a whole lot easier than fixing them after-the-fact.
For example, a robust hashmap might randomize the order of iteration over elements 1/2 the time, or a robust priority queue might randomize the relative order of elements with the same priority. Or even randomly changing the order of evaluating function arguments. Or a function with a callback that is defined to potentially be called multiple times (distributed systems, etc) might explicitly call the callback a random number of times.
It might make more sense to only do some of these on debug builds.
- thesz 12y agoPlease, find a language where such behavior is a matter of library. http://en.wikipedia.org/wiki/QuickCheck http://en.wikipedia.org/wiki/QuickCheck
- TheLoneWolfling 12y agoWell, Go has (limited) randomization of hashmap iteration order.