Note: Created with the help of Bard + ChatGPT on 2023-12-30.
name | rules | examples | usage |
---|---|---|---|
1. Camel Case (lowerCamelCase) | Starts with a lowercase letter. Subsequent words are capitalized, without spaces or separators | firstName , calculateArea , isRunning |
variables, functions, methods in many languages (Java, Python, JavaScript, etc.) |
2. Pascal Case (UpperCamelCase) | All words are capitalized, without spaces or separators | FullName , CalculateArea , IsRunning |
class names, modules, namespaces in languages like Java, C#, Python, and others |
3. Snake Case (snake_case) | All letters are lowercase. Words are separated by underscores (_). | first_name , calculate_area , is_running |
variables, functions in languages like Python, Ruby, C++, and for file paths and URLs |
4. Kebab Case (kebab-case) | All letters are lowercase. Words are separated by hyphens (-). | first-name , calculate-area , is-running |
command-line arguments, file names, and URLs |
5. Macro Case (MACRO_CASE) | All letters are uppercase. Words are separated by underscores (_). | FIRST_NAME , CALCULATE_AREA , IS_RUNNING |
constants, macros, and environment variables |
6. Train Case (Train-Case) | Words are capitalized, separated by hyphens (-) | First-Name , Calculate-Area , Is-Running |
also known as HTTP-Header-Case, file names, URLs |