Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bikeshed the name #33

Open
tabatkins opened this issue Mar 5, 2025 · 4 comments
Open

Bikeshed the name #33

tabatkins opened this issue Mar 5, 2025 · 4 comments

Comments

@tabatkins
Copy link
Collaborator

#31 points out, correctly, that since the function is a constructor, it needs to start with a capital letter. Let's open up the naming discussion more broadly, tho.

The current name (seededPRNG) came from @erights's complaint during a plenary that we should be clear this is a PRNG, not "true" randomness. (See #3). However, Math.SeededPRNG() is annoying to type; notably, the four letters of PRNG alternate between hands on a qwerty keyboard, so you have to constantly press and release alternating Shift keys, which is annoying and easy to make a mistake with. Even the initial capital S is on the opposite hand from the capital P, making the alternation even worse.

Other suggestions I find reasonable:

  • just Math.PRNG(). Still has the alternating-hands problem, but at least it's six characters shorter and loses one capital.
  • Math.SeededRandom(). Less capitals, and the notion of "seeded" already necessarily implies a PRNG.
  • something else?
@bakkot
Copy link

bakkot commented Mar 5, 2025

SeededRandom works for me if the committee approves. SeededPRNG is also fine though.

I don't like Math.PRNG because Math.random is also a PRNG and I don't want to imply otherwise.

(I type "PRNG" while holding Shift down with my left pinky, without releasing it, and am mystified by the claim that you have to press and release alternating Shift keys.)

@tabatkins
Copy link
Collaborator Author

Lol, I always press Shift with the hand that's not typing the letter, so the letter hand is free to move normally.

@michaelficarra
Copy link
Member

I share Mark's preference for the term PRNG over Random. I think SeededPRNG is a fine name.

I forgot there was a second shift key on the keyboard. I only ever use the left one. 🤷‍♂

@erights
Copy link

erights commented Mar 6, 2025

+1 SeededPRNG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants