# SE-0202 Amendment Proposal: Rename Random to DefaultRandomNumberGenerator

**URL:** <https://forums.swift.org/t/se-0202-amendment-proposal-rename-random-to-defaultrandomnumbergenerator/12942>\
**Category:** Proposal Reviews\
**Created:** [May 24, 2018, 3:48pm UTC](https://forums.swift.org/t/se-0202-amendment-proposal-rename-random-to-defaultrandomnumbergenerator/12942 "2018-05-24T15:48:18Z")\
**Posts on this page:** 1\
**Showing post:** 45

<div class="post-metadata">

**Author:** ![bzamayo](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/bzamayo/32/764_2.png) [@bzamayo](https://forums.swift.org/u/bzamayo)\
**Post date:** [May 25, 2018, 9:53am UTC](https://forums.swift.org/t/se-0202-amendment-proposal-rename-random-to-defaultrandomnumbergenerator/12942/45 "2018-05-25T09:53:04Z")

</div>

To be clear, I have no qualms about making a namespace like `Random` which would house properties like `default`. What I do not like is the default random number generator object being named `Random` itself. It's just the wrong name. At the very least, it should be called `RandomGenerator` to actually describe what the object is. `Random` isn't descriptive of anything, it's at best poor shorthand. It refers to the domain of randomness rather than what this particular type is.

Let's imagine we introduced a Random namespace or submodule (something that was never formally proposed or agreed on in SE-202) but clearly has many people desiring it. We would still need a name for the stdlib generator. You could conceivably imagine:

```swift
enum Random { // namespace
    var `default`: DefaultRandomNumberGenerator { ... }
}

```

I personally would love to hang a default instance accessor off of the `RandomNumberGenerator` protocol type itself, so you could declare something like `func random(using generator: RandomNumberGenerator = .default)`. Again, this requires a fully-formed name for the type vended.

```swift
extension RandomNumberGenerator.Type { // this is obviously hypothetical syntax of a feature that is nowhere close to implementation currently
      static var `default`: DefaultRandomNumberGenerator { ... }
}

```

The mere fact that people keep proposing the idea of `Random` as a 'namespace' is indicative that `Random` is not the correct name for a RNG source struct. If this proposal was already out in the wild, part of the public Swift language, I would agree it is not so harmful to be worthy of renaming and code churn. But pointedly, it is not yet finalized API. There are no source compatibility concerns at this stage.

---

_[View the full topic](https://forums.swift.org/t/se-0202-amendment-proposal-rename-random-to-defaultrandomnumbergenerator/12942)._
