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
| Convention | Description | Typical Use |
|---|---|---|
PascalCase | Each word capitalized | Classes, types, interfaces |
camelCase | First word lowercase, rest capitalized | Variables, functions, methods |
snake_case | All lowercase, words separated by _ | Python vars/functions, DB columns, Rust functions |
SCREAMING_SNAKE_CASE | All uppercase with _ | Constants, environment variables |
kebab-case | All lowercase, words separated by - | File names, Kubernetes resources, URLs |
Universal Rules
These apply regardless of language:
- Be descriptive.
getUserByIdis a name;gubidis a mystery. - Qualify your names. A file called
utils.tsor a class calledManagertells 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 likeDataProcessororHandler. - 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
📄️ TypeScript
Naming conventions for TypeScript and React projects.
📄️ Java
Naming conventions for Java projects.
📄️ .NET
Naming conventions for C# and .NET projects.
📄️ Python
Naming conventions for Python projects.
📄️ Rust
Naming conventions for Rust projects.