gtap-dev / javascript

JavaScript Style Guide
MIT License
0 stars 0 forks source link

23.9 - readability of acronyms #12

Closed mjomble closed 2 days ago

mjomble commented 3 years ago

The rationale for this rule is that HTTPRequests, for example, is more readable than HttpRequests. But readability tends to be quite subjective and for me, it's the other way around. Probably just because I've been using this convention for a long time.

Perhaps we could put this to a vote to see which one is preferred among our developers?

React with 🚀 if you think HTTPRequests is more readable React with 👀 if you think HttpRequests is more readable

mihkeleidast commented 3 years ago

airbnb/javascript#653 brought XMLHttpRequest as an "official" example so it's definitely subjective :)

Vladisls commented 3 years ago

I propose a third option. Remove the rule and give the right to decide to the developer (keeping in mind that in the context of one project the same names should be cased in the same way).

mihkeleidast commented 3 years ago

Another point: HttpRequest is enforceable with linters (as it's definitely PascalCase), HTTPRequest is not, since linters do not know about valid acronyms and abbrevations.