-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Use thin-space (U+2009) as a numeric separator in regular English language #14635
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
Use thin-space (U+2009) as a numeric separator in regular English language #14635
Conversation
#### Problem | ||
|
||
An `Atom` is an Elixir basic type whose value is its own name. Atoms are often useful to identify resources or express the state, or result, of an operation. Creating atoms dynamically is not an anti-pattern by itself. However, atoms are not garbage collected by the Erlang Virtual Machine, so values of this type live in memory during a software's entire execution lifetime. The Erlang VM limits the number of atoms that can exist in an application by default to *1_048_576*, which is more than enough to cover all atoms defined in a program, but attempts to serve as an early limit for applications which are "leaking atoms" through dynamic creation. | ||
An `Atom` is an Elixir basic type whose value is its own name. Atoms are often useful to identify resources or express the state, or result, of an operation. Creating atoms dynamically is not an anti-pattern by itself. However, atoms are not garbage collected by the Erlang Virtual Machine, so values of this type live in memory during a software's entire execution lifetime. The Erlang VM limits the number of atoms that can exist in an application by default to *1,048,576*, which is more than enough to cover all atoms defined in a program, but attempts to serve as an early limit for applications which are "leaking atoms" through dynamic creation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue is that commas are locale specific. Not all languages and location use the same. For example, in Brazil, we would use dots. Perhaps we do `1_048_576`
and have it show up as actual code, as in the other PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But the documentation is written in English language. I would say along with the white-space separator is the most common in English speaking countries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Language and localization are two different things. Assuming people speak english is one thing but assuming they are all in a certain locale is another. But without going into this whole discussion, let's ask this instead:
- Do we use this convention anywhere else in the codebase?
- Why not use
1_048_576
is would be unambiguous for Elixir developers regaradless of their locale?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use it only here:
lib/elixir/lib/calendar/time.ex
784: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
840: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
lib/elixir/lib/calendar/date.ex
636: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
670: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
lib/elixir/lib/calendar/datetime.ex
1925: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
1972: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
lib/elixir/lib/calendar/naive_datetime.ex
1264: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
1330: Gregorian calendar that adds exactly 10,000 years to the current Gregorian
Using 1_048_576
works in this case because it is not an introductory material, but given the case of someone new to Elixir reading this, I don't think _
would mean much.
I'm OK with using 1_048_576
, but I think it is something to think about.
Perhaps we could follow the Bureau International des Poids et Mesures (BIPM) recommendations and use either a non-breaking space or a thin space ? From Wikipedia
|
Using thin space sounds good to me. There is a chance someone will copy it to Elixir but we should show a good error message. |
Should we go ahead and replace the "10,000 years" entries as well? |
Yes, let’s do it please. |
💚 💙 💜 💛 ❤️ |
Thank you Kip for the suggestion. |
No description provided.