Naming things is famously one of the hardest problems in programming. Picking the wrong naming convention for the wrong context is a small but persistent source of bugs and confusion.
The Main Naming Conventions
camelCase — each word starts with a capital letter except the first. Used in JavaScript variables/functions, Java, Swift, and JSON keys. Example: getUserData
PascalCase — like camelCase but the first word is also capitalized. Used for class names, React components, and C# types. Example: UserProfile
snake_case — all lowercase, words separated by underscores. Used in Python, Ruby, database columns, and file names. Example: get_user_data
SCREAMING_SNAKE_CASE — all uppercase with underscores. Used for constants and environment variables. Example: API_BASE_URL
kebab-case — all lowercase, words separated by hyphens. Used in HTML attributes, CSS classes, URL slugs, and CLI flags. Example: my-component
Why Mixing Conventions Actually Breaks Things
This isn't just a style preference — it causes real bugs. A common one: a backend API returns JSON with snake_case keys (user_id, created_at) because it's written in Python, but the frontend JavaScript expects camelCase (userId, createdAt) by convention. Without a conversion layer, code silently reads undefined for every field, since data.user_id and data.userId are completely different property names to JavaScript. This exact mismatch is one of the most common integration bugs between Python/Ruby backends and JavaScript frontends.
Where These Conventions Actually Came From
snake_case dates back to early C and Unix conventions, where terminals and compilers had limited character support and readability mattered in fixed-width fonts. camelCase became dominant in Java and later JavaScript partly because it produces shorter identifiers than snake_case, which mattered more as codebases and file sizes grew. kebab-case exists mainly because URLs and CSS class names can't contain underscores as reliably across older browsers and web servers, making hyphens the safer default.
Quick Reference by Context
| Context | Convention |
|---|---|
| JavaScript variables | camelCase |
| JavaScript classes | PascalCase |
| Python variables | snake_case |
| CSS classes | kebab-case |
| URL slugs | kebab-case |
| Database columns | snake_case |
| Environment variables | SCREAMING_SNAKE_CASE |
| React components | PascalCase |
Convert Between Cases Instantly
Use the Anonymiz Case Converter to convert any text to camelCase, snake_case, kebab-case, PascalCase, SCREAMING_SNAKE_CASE, Title Case, or dot.notation in one click. No signup needed.


