3.2 Naming Conventions
At the very beginning of this section of the webpage, I mentioned discussing camelCase, UpperCamelCase (i.e., PascalCase), and snake_case during the week’s lecture; these are all conventions of separating words!
Their conventions are as follows:
camelCase
In camelCase, words are separated via the capitalization of their first letters. So, thisIsCamelCase. This is not!
In Python, it is not uncommon to see developers use camelCase to name variables and functions!
UpperCamelCase (i.e., PascalCase)
This is very similar to camelCase, albeit the first letter of the first word is also capitalized. ThisIsUpperCamelCase. thisIsCamelCase. This is neither!
UpperCamelCase - to my knowledge - is used to name classes in Python!
snake_case
Unlike both camelCases, snake_case uses underscores to separate words. So, this_is_an_example_of_snake_case!
To my knowledge, snake_case is used to name constants in Python. It is also generally accepted for constants to be NAMED IN ALL CAPS (hence snake_case would make sense here).
More information on Python’s naming conventions can be found via this link: https://namingconvention.org/python/