Naming rule: Case acronyms as words


Naming rule: Case acronyms as words.

🚫 getURLParam
βœ… getUrlParam

🚫 parseHTTPRequest
βœ… parseHttpRequest

The second one is easier to read because it’s easier to see the words.

This is especially obvious with repeated acronyms:

🚫 parseRESTAPIURL
βœ… parseRestApiUrl
Google’s JavaScript style guide agrees.

https://google.github.io/styleguide/jsguide.html#naming-camel-case-defined

View original on X