SE-0202 Amendment: Naming of the standard library random number generator

I'll throw in DefaultRNG here too. It's simply an abbreviated form of my originally proposed name, but it still conveys what's important whilst saving characters (which has been a common criticism in this thread even given the fact writing out the name of the actual type is likely a rare occurrence.)

The complaint is never about writing, it’s about mental effort required to parse it each and every time.

1 Like

True... I think the discussion about how to actually use the API got sidelined to much by implementation details -- but I hope that the high-level APIs that have to be created yet play well with the accepted proposal.

Imho it doesn't have this exact issue, but a less clean design than C++:
Because there are methods to choose a random number in a given range, the biased randomValue % (upperBound - lowerBound) transformation is less likely to be used.
But some functionality depends on a hidden transformation (which probably maps to a uniform distribution ;-), so it can look like the generator is a arbitrary distribution.

Hopefully ;-) -- I like the pattern of a generator parameter whose default value is Random.default, and I expect many high-level APIs to utilize it.

I don't think it's good to use abbreviations, even if it's unlikely that someone who doesn't know the meaning of RNG needs that type.

I think those belong to a Random module:
It's good when the stdlib is tiny and only has rudimentary support, the topic is large enough to fill a separate library.

1 Like