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.

Python Python Basics Meet Python Variables

Podrig Leoghain
Podrig Leoghain
5,094 Points

camelCase vs snake_case

You can use either so, even though PEP8 guidelines states using snake_case, use whatever you're comfortable with. If you're planning on learning other languages (which you should do if you are going to be more than a hobbyist (which is fine!)) then just use camelCase.

Thoughts on this?

2 Answers

Even though most languages use camel case, you should stick with using snake case in Python. Most Python libraries use snake case, and most developers use snake case, so your best bet is to follow their conventions!

Read this post

Podrig Leoghain
Podrig Leoghain
5,094 Points

Does it not bother you that an underscore is an extra, unwieldy to type, symbol? I mean, I could remap a key I suppose...

It feels a little extraneous at first, but eventually it feels natural.