Enforcing Strict CamelCase
1 min readJun 18, 2018
As a JavaScript engineer naming variables can always be a headache. We often use camel case to name variables and JSON properties.
However naming variables with camel case can also be a pain. This normally happens with acronyms, what should this be?
XMLHttpRequest
Technically XML and HTTP are both acronyms, but putting them together creates an unreadable mess.
XMLHTTPRequest
My recommendation:
xmlHttpRequest
And if it’s a class:
XmlHttpRequest
The idea being that there should never be two capital letters next to each other. Meaning things should look like this:
graphqlRequest
Not:
graphQLRequest
Just some ideas on variable naming.