Op Mon, 2 Jun 2008, schreef Michael Van Canneyt:

People might want to start with a defined randseed to reproduce behaviour.

This implies createguid should not call randomize automatically either, it
prevents you having deterministic behaviour, especially in a program where
guids and normal use of the randomizer are combined.

Creating GUIDs should never be deterministic.. ?

For debugging it can be usefull to have deterministic behaviour. But that was not the point. The point was, that a call to randomize "disrupts" the current state of the random generator. That means that if you use random outside guid creation, creating a guid can have unintended side effects on your random generation.

I agree it is nitpicking, but strictly speaking, it is a bad idea to automatically initialize the random generator.

Daniël
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to