Have you ever needed to generate a random number in code? whether it's for rolling a dice, or shuffling a set, this tweet thread is here for you! There's no reason that it should be easy or obvious, very experienced programmers repeat common mistakes. I did, before I learned ...
-
Show this thread
-
Replying to @colmmacc
Nice epic thread on random number generation. I came here to point out "rand() Considered Harmful" talk which is an awesome take on this https://channel9.msdn.com/Events/GoingNative/2013/rand-Considered-Harmful … and slides https://view.officeapps.live.com/op/view.aspx?src=http%3a%2f%2fvideo.ch9.ms%2fsessions%2fgonat%2f2013%2fSTLGN13rand.pptx … In C++ we discourage the use of rand() and have <random>https://stackoverflow.com/a/17798317/1708801 …
1 reply 4 retweets 21 likes -
Replying to @shafikyaghmour @colmmacc
I'd consider <random> harmful, too.https://arvid.io/2018/06/30/on-cxx-random-number-generator-quality/ …
1 reply 0 retweets 5 likes -
Replying to @ArvidGerstmann @colmmacc
I am not sure it is not my specialty, it is not clear to me where these details matter. I guess cryptography and related is one of them. While your write was interesting it did not give me enough context. What if I just want to do simple Monte-carlo are they still ok?
2 replies 0 retweets 1 like -
My 2c: it’s malpractice for the default random in a general purpose language to be anything other than a system-backed CSPRNG.
5 replies 4 retweets 21 likes -
Replying to @stephentyrone @shafikyaghmour and
Not so sure. It's scientific malpractice to do a non-reproducible monte carlo, even moreso if the true randomness leaks into AI training or something.
2 replies 0 retweets 3 likes
True randomness is only needed for a tiny problem domain (cryptography & related security fields) where non-experts should not be writing any new code anyway, just glue.
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.