Naming conventions
Alternate Names for Variable
Common Name | Also Called | Format |
---|---|---|
camelCase | lower camel case dromedary case | startsLowerCaseThenCapitalizesEachWord |
PascalCase | UpperCamelCase CapitalizedCamelCase | EachWordStartsWithCapital |
snake_case | underscore_case pothole_case lower snake case | lower_case_words_separated_by_underscores |
SCREAMING_SNAKE_CASE | constant case all caps snake case upper snake case | UPPER_CASE_WITH_UNDERSCORES |
kebab-case | dash-case lisp-case spinal-case hyphen-case | lower-case-with-hyphens |
Hungarian Notation | type prefixing Apps Hungarian (or Systems Hungarian) | prefixTypeVariableName |
dot.notation | object property access member access syntax | object.property |
UPPERCASE | shouting case (colloquial) all-caps | ALLUPPERCASE |
Common usages and examples
Naming Convention | Usage | Example |
---|---|---|
camelCase | Common in JS, Java, and some Python code for variables and function names | let userName = "FeeFight"; |
PascalCase | Used for class names in C#, Java, TypeScript constructors in JS | class UserProfile {} |
snake_case | Common in Python for variables , function , file names | user_profile = "FeeFight" |
SCREAMING_SNAKE_CASE | Constants in Python, JS, C++ | MAX_CONNECTIONS = 100 |
kebab-case | Used in URLs, CSS classes, file names | background-color: #fff; user-profile.html |
Hungarian Notation | Older C/C++ style, not used much in modern code | strName = "FeeFight" (prefix indicates type: str = string) |
dot.notation | Used for accessing object properties or nested values | user.profile.name |
UPPERCASE | Legacy style, sometimes used for constants or macros | DEBUG = TRUE |
Quick Notes
- camelCase: Standard in JS, Java, C++, often for functions and variables.
- PascalCase: Ideal for classes, components, and constructors.
- snake_case: Preferred in Python, also common in configs and databases.
- SCREAMING_SNAKE_CASE: Great for environment variables and constants.
- kebab-case: Only valid in filenames, CSS, and HTML—not in most programming languages (it breaks in JS/Python).
- Hungarian Notation: Old-school, can be useful in embedded systems but not recommended in modern high-level languages.
- dot.notation: Not a naming convention itself, but a way of referencing properties in an object.