If you've worked across multiple languages or frameworks, you've probably noticed that naming conventions are everywhere, and they're not always consistent. Each project uses something different. camelCase, another prefers snake_case, and suddenly you're context-switching between PascalCase components and kebab-case CSS classes.
This is a quick reference I keep handy when I'm switching projects or reviewing code. It covers the most common naming conventions, where they're typically used, and why. It's nothing fancy; it's a cheat sheet that saves me from second-guessing myself when I'm deep in the work.
A quick reference guide to the naming conventions used across programming languages, documentation, and UI design.
Common Case Types
camelCase
- The first word is lowercase, subsequent words are capitalized
-
Example:
myVariableName - Commonly used in: JavaScript, Java, and for variables or function names
PascalCase
- Every word is capitalized, including the first
-
Example:
MyVariableName - Often used for: Class names, types, or components in many languages
kebab-case
- Words are lowercase and separated by hyphens (
-) -
Example:
my-variable-name - Often used in: URLs, file names, CSS class names
snake_case
- Words are lowercase and separated by underscores (
_) -
Example:
my_variable_name - Common in: Python, databases, and some configuration files
SCREAMING_SNAKE_CASE
- Like snake_case but all uppercase
-
Example:
MY_VARIABLE_NAME - Often used for: Constants
Train-Case
- Like PascalCase but with hyphens
-
Example:
My-Variable-Name - Usage: Less common, sometimes used in URLs or documentation
dot.case
- Words separated by dots (
.) -
Example:
my.variable.name - Sometimes used in: Config files or namespaces
Title Case
- Capitalize the first letter of most words (like a book title)
-
Example:
My Variable Name - Often used in: Headings, menu items, or UI text
Sentence case
- Only the first word (and proper nouns) capitalized
-
Example:
My variable name - Common in: Normal text, documentation, and UI instructions
lowercase
- Everything in lowercase, no separators
-
Example:
myvariablename - Usage: Rare, but sometimes used in URLs or legacy systems
Notes and Patterns
Many of these are interchangeable depending on context: programming language, framework, or documentation style.
You'll often see a mix in modern projects:
JavaScript:
-
camelCasefor variables -
PascalCasefor classes -
SCREAMING_SNAKE_CASEfor constants
Python:
-
snake_casefor functions and variables -
PascalCasefor classes -
SCREAMING_SNAKE_CASEfor constants
CSS / HTML:
-
kebab-casefor class names and IDs
Closing
Naming conventions matter more than they should, but they do matter. Consistency makes code easier to read, review, and maintain. It also makes onboarding smoother when you're working with a team or picking up someone else's work.
If this helps you avoid one moment of "wait, should this be camelCase or snake_case?" then it's done its job. Bookmark it, share it, or keep it handy. Whatever makes your workflow a little smoother.

Top comments (0)
Some comments may only be visible to logged-in visitors. Sign in to view all comments.