From the course: JavaScript: Best Practices for Data

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Standardize acronym case

Standardize acronym case - JavaScript Tutorial

From the course: JavaScript: Best Practices for Data

Start my 1-month free trial

Standardize acronym case

- [Instructor] I'm working with three variables here whose names all include acronyms. COGS is used in business as a shorthand for cost of goods sold. YTD is a financial abbreviation for year to date, and I'm using NOP to stand for net operating profit. No matter how faithful I am with my camel case, it can all get really confusing really fast when I throw an acronym into the mix. In some places, acronyms are all caps, while in others, an acronym is denoted by an initial cap. Either standard can require its own approach in variable naming. My first variable name uses all lowercase, which is standard for a single word variable name. My second uses an initial cap for the acronym, then camel cases the next word. And my final variable uses the all caps format for an acronym. Add into the mix the fact that an initial cap to variable name has specific meanings in JavaScript, and picking a name can make your head spin. And…

Contents