Meta: Add naming conventions section in style guide#996
Conversation
| #### Rationale | ||
|
|
||
| - Descriptive names improve code readability and maintainability. | ||
| - They reduce the cognitive load for developers, especially those new to the specification. |
There was a problem hiding this comment.
Also, spelled-out names are more accessible to non-native English speakers, because they are more googlable, etc. We are building an i18n library, after all.
There was a problem hiding this comment.
What about the immediately following point? I believe it comes close so at the very least I should add something along these lines to it (or after it).
|
|
||
| #### Rationale | ||
|
|
||
| - camelCase is a widely accepted convention in JavaScript and aligns with existing ECMA-402 practices. |
There was a problem hiding this comment.
Please dig up the thread in NumberFormat V3 where this was discussed, but we had a number of other reasons. One was that sometimes these strings end up as identifiers, and identifiers in JavaScript are camel case.
There was a problem hiding this comment.
Is this it? tc39/proposal-intl-numberformat-v3#9
There was a problem hiding this comment.
Yeah, I thought that was the original issue but I guess it is tc39/proposal-intl-displaynames#32
Actually, the style guide already says to use camel case here. There is a big section explaining the rationale. I think just refer to that previous section.
| #### Guidelines | ||
|
|
||
| - Use camelCase for property names and values that are compound words (good examples: `signDisplay`, `"exceptZero"`). | ||
| - Avoid separating words with underscores, hyphens, or other delimiters (historical exceptions: "2-digit", "best fit"). |
There was a problem hiding this comment.
| - Avoid separating words with underscores, hyphens, or other delimiters (historical exceptions: "2-digit", "best fit"). | |
| - Avoid separating words with underscores, hyphens, or other delimiters (historical exceptions: `"2-digit"`, `"best fit"`). |
Fixes: #536
Took a stab at it, let me know what you think about the phrasing.