camelCase vs. snake_case vs. kebab-case: Where Each Is Used
camelCase (capitalizing each word after the first, no separators) is conventional in many programming languages for variable and function names. snake_case (lowercase with underscores) is conventional in other languages and in database column names. kebab-case (lowercase with hyphens) is conventional for URLs and CSS class names — the right choice depends entirely on the specific technical context's own convention.
Unlike Title Case and sentence case, these naming conventions come from programming and web development contexts, where consistency with a specific language or system's convention genuinely matters for compatibility and readability.
camelCase
Widely used in JavaScript, Java, and several other languages for variable and function names — the first word is lowercase, and each subsequent word starts with a capital letter, with no spaces or separators ("firstName," "calculateTotal").
snake_case
Common in Python, Ruby, and widely used for database column and table names — all lowercase, with underscores separating words ("first_name," "calculate_total"), generally considered highly readable for longer multi-word names.
kebab-case
The standard for URLs (search engines and users both generally prefer readable, hyphenated URLs) and CSS class names — all lowercase, with hyphens separating words ("first-name," "calculate-total"); it isn't used for variable names in most programming languages, since hyphens conflict with the subtraction operator in most languages' syntax.