-
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
base: main
Are you sure you want to change the base?
Changes from all commits
3bcaa31
c517c9c
49bcef7
d8ce305
4a70295
ca03ebf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -2205,7 +2205,7 @@ is a request, rather than a guarantee. | |||||
Use strings as the values for constants or sets of enumerated values. | ||||||
|
||||||
Strings make it easier for developers to inspect values | ||||||
and read code that uses those values. | ||||||
and read code that uses those values (see [[#naming-is-hard]]). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this fits better in the first paragraph:
Suggested change
|
||||||
In JavaScript engines there is no performance benefit | ||||||
to using integers instead of strings. | ||||||
The values of a [WebIDL enum type](https://webidl.spec.whatwg.org/#idl-enums) | ||||||
|
@@ -3798,6 +3798,9 @@ API naming *must* be done in easily readable US English. | |||||
Keep in mind that most web developers aren't native English speakers. | ||||||
Whenever possible, names should be chosen that use common vocabulary | ||||||
a majority of English speakers are likely to understand when first encountering the name. | ||||||
Abbreviations should be avoided, | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://github.com/w3ctag/process/blob/main/style-guide.md#use-the-active-voice
Suggested change
|
||||||
except in cases where an abbreviation is extremely common and easy to understand. | ||||||
For example `UIEvent`, where "`UI`" stands for user interface. | ||||||
Comment on lines
+3801
to
+3803
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
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. |
||||||
|
||||||
<div class="example"> | ||||||
|
||||||
|
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.