4 ms·
Having your random number generator be deterministic by default is extremely bad. Using a deterministic seed should be the exceptional case. In those cases, th
by mystified5016 2y ago
Having your random number generator be deterministic by default is extremely bad. Using a deterministic seed should be the exceptional case.
In those cases, they provide deterministic operation under a different set of functions so nobody does anything as stupid as using deterministic RNG as encryption
- Someone 2y agoBut if you compile some third-party code that doesn’t know of that API change, and then use it, that can lead to disaster. For an example, see the GP post at https://news.ycombinator.com/item?id=42971287 https://news.ycombinator.com/item?id=42971287. I think it would have been better to remove rand and srand, and provide two replacement functions with different names, or require all users to pick one using a #define.