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

Leisa Clark
Leisa Clark
4,531 Points

How come you can use capital letter HTML and CSS as the start of the variance, I thought no capitals to begin??

Can you use HTML and CSS to begin a variance even thought they are capital letters? I thought we were taught to only start variance names with lower case??

Leisa Clark
Leisa Clark
4,531 Points

example var HTMLBadges var CSSBadges

I thought it would have to be

var htmlBadges var cssBadges

2 Answers

Sean T. Unwin
Sean T. Unwin
28,690 Points

My answer would be that it's because those are proper acronyms so it's a way for them to stand out as such.

Cale Matteson
Cale Matteson
11,303 Points

Always use the same naming convention for all your code. For example:

Variable and function names written as camelCase

Global variable written in UPPERCASE

Constants (like PI) written in UPPERCASE

Should you use hyp-hens, camelCase, or under_scores in variable names?

This is a question programmers often discuss. The answer depends on who you ask.

src:http://www.w3schools.com/js/js_conventions.asp

It /can/ cause problems in other languages. But with JS its fine. Its preference and as a community as a whole to try and make your code more readable for everyone.