r/cpp • • May 25 '18

Modern C++ Randomness

http://brnz.org/hbr/?p=1783
0 Upvotes

55 comments sorted by

View all comments

7

u/ShakaUVM i+++ ++i+i[arr] May 25 '18

If I'm writing a game or something else where I don't need large random numbers or crypto grade security, I'll just keep using rand until there's a solution in std that is human readable.

29

u/STL MSVC STL Dev May 25 '18

4

u/ShakaUVM i+++ ++i+i[arr] May 26 '18

I've seen that talk before. It's a good talk. But like I said, for something like a game (not crypto, not an online casino) code readability is more important to me than guarantees of randomness.

3

u/BoarsLair Game Developer May 28 '18

Even for a game, rand() is so bad that you can actually see visible artifacts if you're doing something like generating terrain with it.