Krill KitsKrill Kits// A swarm of small, sharp tools for letters, numbers, and units.
§ 01 / ARTICLE

Naming Conventions. By Language.

CATEGORY TEXTREAD 4 MINPUBLISHED APR 21, 2026

Every language has a naming convention, and for once it's not personal preference — it's enforced by tooling, reviewed by teammates, and baked into the standard library. Here's the cheat sheet.

The big ones

  • Python — snake_case for variables and functions, PascalCase for classes, SCREAMING_SNAKE_CASE for constants.
  • JavaScript / TypeScript — camelCase for variables and functions, PascalCase for classes and React components, SCREAMING_SNAKE_CASE for constants.
  • Java — camelCase for methods and variables, PascalCase for classes, SCREAMING_SNAKE_CASE for constants.
  • Go — PascalCase for exported identifiers, camelCase for package-private. Case is syntactically meaningful — uppercase = public.
  • Rust — snake_case for variables and functions, PascalCase for types and traits, SCREAMING_SNAKE_CASE for constants.
  • Ruby — snake_case for variables and methods, PascalCase for classes and modules, SCREAMING_SNAKE_CASE for constants.
  • C / C++ — historically all-over-the-place. Modern convention: snake_case for variables, PascalCase for types, SCREAMING_SNAKE_CASE for macros.

The markup / data formats

  • HTML attributes — kebab-case (data-user-id, aria-label).
  • CSS classes + custom properties — kebab-case (.main-nav, --brand-color).
  • JSON — no official convention; follows the consuming language. APIs in the JS ecosystem use camelCase; in Python, snake_case.
  • YAML — usually snake_case, occasionally kebab-case.
  • XML element names — often PascalCase, sometimes kebab-case.

Databases + SQL

  • SQL keywords — SCREAMING_SNAKE_CASE by convention (SELECT, FROM, WHERE).
  • Table + column names — snake_case (user_accounts.first_name). Quoted identifiers can be anything, but snake_case is dominant.
  • PostgreSQL — enforces lowercase-only by default unless you quote identifiers.

Environment vars + CLI

  • Env vars — SCREAMING_SNAKE_CASE universally (DATABASE_URL).
  • CLI flags — kebab-case for long options (--dry-run, --output-format).
  • File names — kebab-case on the web (SEO-friendly URLs), snake_case in Python/Ruby projects, PascalCase for .NET.
// TRY THE TOOL
CONVERT A NAME.

13 case formats, live conversion. The fast path between camelCase, snake_case, kebab-case, and the rest.

OPEN →
§ 02 / FAQ

Questions. Answered.

Why don’t all languages use the same naming convention?+
Historical accident plus stylistic choice. Python took snake_case from its standard library. JavaScript adopted camelCase from Java. CSS uses kebab-case because hyphens were already reserved as valid identifier chars. Once conventions stuck, they stuck.
Does it matter if I follow the language convention?+
Yes. Your code will be read by other developers who expect the conventions. Tooling (linters, formatters) enforces them. Going against grain costs readability for no benefit.
What about constants?+
Most languages use SCREAMING_SNAKE_CASE for constants — Python, JS, Java, C, Rust. SQL uses it for keywords. The convention survives across languages because it’s instantly visually distinct.
How do I convert between conventions?+
Use the Case Converter — it handles camelCase ↔ snake_case ↔ kebab-case ↔ PascalCase ↔ SCREAMING_SNAKE_CASE and 8 more. Especially useful for API work where you convert between frontend (camelCase) and database (snake_case) field names.
§ 03 / TOOLS

Related calculators.

§ 04 / READING

Keep reading.