When to use camelCase, PascalCase, UPPER_CASE, kebab-case, and snake_case.
Ultimately, it’s dependent on language.
JavaScript
- camelCase
- variableNames
- objectMethods
- PascalCase
- ClassDeclarations
- Enums
- UPPER_CASE
- GLOBAL_VARIABLES
- ENUM_OPTION (also preferred to be singular nouns)
- CONSTANTS (like Pi)
- kebab-case
- Not allowed in JavaScript, although CSS uses it extensively
- snake_case
- Not a thing in JavaScript, although file names on servers use it
Languages Using Each
- camelCase
- Java & JavaScript
- PascalCase
- Coding in C
- UPPERCASE
- lowercase
- filenames on servers
- kebab-case
- CSS
- snake_case
- SQL