Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript JavaScript Basics (Retired) Working With Numbers Numbers and Strings

Houssein Abil
seal-mask
.a{fill-rule:evenodd;}techdegree
Houssein Abil
Full Stack JavaScript Techdegree Student 1,047 Points

Naming in Javascript

Why in the exercise the name the variable HTMLBadges and CSSBadges in capital letters when we know that in Javascript the convention is to use the camelCase naming?

3 Answers

Harry Clarkson
Harry Clarkson
7,677 Points

your right it is a convention to write it out like htmlBadges but as there variable names the convention mainly affects the programmer (as there likely to get confused which convention to use) but in general, try to use the same naming convention throughout so, in this case, capitalize acronyms. Found this if you want to read more - http://stackoverflow.com/questions/15526107/acronyms-in-camelcase

Khem Myrick
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Khem Myrick
Python Web Development Techdegree Graduate 18,701 Points

Is there a consensus opinion on this? There seems to be controversy in the thread on that link, but one of the opinions is that acronyms should simply be treated as normal lowercase words to avoid confusion, which sounds like the most intuitive option if the ultimate goal is consistency.