Skip to main content

Code & File Naming

Every language has its own idiomatic casing conventions. Follow them — don't fight them. A Java developer reading Python code expects snake_case; a Python developer reading Java expects PascalCase for classes. Consistency with the ecosystem reduces cognitive load more than any internal standard can.

Casing at a Glance

ConventionDescriptionTypical Use
PascalCaseEach word capitalizedClasses, types, interfaces
camelCaseFirst word lowercase, rest capitalizedVariables, functions, methods
snake_caseAll lowercase, words separated by _Python vars/functions, DB columns, Rust functions
SCREAMING_SNAKE_CASEAll uppercase with _Constants, environment variables
kebab-caseAll lowercase, words separated by -File names, Kubernetes resources, URLs

Universal Rules

These apply regardless of language:

  • Be descriptive. getUserById is a name; gubid is a mystery.
  • Qualify your names. A file called utils.ts or a class called Manager tells you nothing. Add enough context that a reader knows what it contains before opening it.
  • Match your domain. Use the words your business uses — Order, Fulfillment, Shipment — not generic technical terms like DataProcessor or Handler.
  • Pick one style per context and hold it. Mixed conventions in a codebase are worse than any single imperfect convention applied consistently.

Language-Specific Conventions