Welcome to the Treehouse Community
The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Michael Godard
5,399 PointsDoes the first letter of a variable name have to be lowercase?
Why do programmers use camelcase as opposed to title case? Can you not capitalize the first letter of a variable name?
4 Answers

Cena Mayo
55,236 PointsHi Michael,
It depends on the language. In JavaScript, you can technically use capitalized variable names, but the convention is to use lowercase words for variable names, and capitalized words for constructors.
In other languages, such as Ruby, capitalized labels are disallowed for variable names, as they're used by constants, methods, and classes.

Luke Pettway
16,591 PointsNo and yes. It helps with clarity and in some programming languages it is even required to follow that convention. In Javascript specifically class constructors are always instantiated with a capital letter at the beginning of their name. It would get confusing really quickly if you started variables, classes, and anything else like that.

Piyush Patel
17,253 PointsNo, it is not a rigid rule. However, in Javascript, most programmers use camel-case notation, meaning you'll use the first word in lowercase and the other words in capitalized format. like "var nameOfPerson"

Aakash Srivastav
Full Stack JavaScript Techdegree Student 11,626 PointsYou can capitalize the first letter of variable any variable but that's used for naming constructors.
Luke Pettway
16,591 PointsLuke Pettway
16,591 PointsBeat me to it!