-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Description
How should we capitalize abbreviations and acronyms? This is an area where Core JavaScript Coding Standards are not prescriptive (but perhaps should be).
For example, in assigning a user ID variable, which is preferable:
userIduserID
The language / DOM are not especially consistent here:
There was a similar discussion in developing adapted standards in Calypso, resulting in camel-case covering abbreviations and acronyms:
The reasoning being: It simplified the documentation and thought-process to recommend camelCase for everything, including abbreviations and acronyms.
In retrospect, the language itself is quite consistent on upper-cased abbreviations and acronyms (getElementById and XMLHttpRequest are browser-specific additions). Anecdotally, other libraries tend toward the same, e.g. ReactDOM, TinyMCE. I've started to adopt this in my Gutenberg work (withAPIData), but I feel we should formalize one way or the other, and update inconsistencies (withInstanceId).
Yes, this is a bikeshed.