-
Notifications
You must be signed in to change notification settings - Fork 54
Avoid abbreviations for strings and enums #600
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
Conversation
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.
Pull Request Overview
This PR updates documentation to provide clearer guidance on string and enum naming conventions. The change adds explicit advice to avoid abbreviations when using strings as constants or enumerated values, emphasizing code readability.
- Added guidance to avoid abbreviations in string constants and enums
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
index.bs
Outdated
| Abbreviations should be avoided, | ||
| except in cases where an abbreviation is extremely common and easy to understand. | ||
| For example `UIEvent`, where "`UI`" stands for user interface. |
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.
This is an example of "Value readability over brevity" in the next non-example paragraph. How about
Value readability over brevity.
Often this means to avoid abbreviations.
Keep in mind, however, that
You could add the "UI" example into that example. It might be good to also have an example of when the abbreviation was a mistake.
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.
I think Intl namespace was a mistake from ECMA was a mistake. Would other folks here agree?
Co-authored-by: Jeffrey Yasskin <[email protected]>
Co-authored-by: Jeffrey Yasskin <[email protected]>
jyasskin
left a comment
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.
This would fit better into the "Value readability over brevity." paragraph and the example that follows it, but this is good enough for me.
|
I agree with Jeffrey. This is more naturally under "brevity". |
SHA: 9fc15ba Reason: push, by marcoscaceres Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This pull request makes a minor update to the documentation for using strings as constant values. The change clarifies that abbreviations should be avoided, as they can make code harder to read.
Closes #599
Preview | Diff