A quick discussion of the most popular ways to invoke variable (or constant) names using case and/or space replacement.
These styles are:
- camelCase
- PascalCase
- snake_case
- kebab-case
Note: Unless otherwise indicated, languages without parenthetical explanation are referencing variable conventions.
AKA, Dromedary Camel Case (a Dromedary Camel has one less hump than a Bactrian Camel)
- Example:
firstLetterIsLowerCaseFollowedByWordCaps
- Languages: JavaScript (variable & function names), Golang, Java
AKA, UpperCamelCase, StudlyCase
- Example:
EveryWordIsTitleCased
- Languages: JavaScript, Golang (public structs or functions), Java & Python (Classes)
- Example:
words_are_lower_cased_with_underscores_in_between
- Languages: Python, Ruby
- Example:
WORDS_ARE_UPPER_CASED_WITH_UNDERSCORES_IN_BETWEEN
- Languages: Python & JavaScript (constants)
- Example:
words-are-lower-cased-with-hyphens-in-between
- Languages: HTML5, CSS (attributes, property names)