1---2name: code-naming3description: Naming decisions for variables, functions, classes, constants, and APIs. Use when choosing names, reviewing naming quality, refactoring unclear names, or establishing naming conventions. Covers descriptive naming, naming as documentation, language-specific conventions, and common naming antipatterns. Use when this capability is needed.4---56# Code Naming78## The Naming Decision Table910| You're naming a... | It should read like... | Form | Examples |11|---------------------|----------------------|------|----------|12| **Class / Type** | A noun or noun phrase | PascalCase (most langs) | `UserProfile`, `HttpClient`, `InvoiceParser` |13| **Function / Method** | A verb or verb phrase | camelCase or snake_case | `validateEmail`, `send_invoice`, `calculateTotal` |14| **Boolean** | A yes/no question | `is`/`has`/`can`/`should` prefix | `isActive`, `hasPermission`, `canRetry` |15| **Collection** | A plural noun | Plural form | `users`, `pendingOrders`, `activeConnections` |16| **Constant** | A named fact | UPPER_SNAKE_CASE (most langs) | `MAX_RETRY_COUNT`, `DEFAULT_TIMEOUT_MS` |17| **Interface** | A capability or contract | Language-specific | `Serializable`, `IDisposable`, `Reader` |18| **Enum** | A set of named options | PascalCase values | `Color.Red`, `RetryPolicy.ALLOW_RETRY` |19| **Event / Callback** | What happened or will happen | Past/present tense | `onClick`, `onUserCreated`, `handleSubmit` |2021## The Three Questions Test2223Before committing to a name, verify it answers all three:24251. **What is it?** — The name identifies what the thing represents262. **What does it do?** — For functions: the action is clear from the name alone273. **What are the boundaries?** — The name hints at scope, lifetime, or constraints2829If a name requires a comment to be understood, the name is wrong.3031## Naming Antipatterns3233### Names That Lie3435| Antipattern | Problem | Fix |36|-------------|---------|-----|37| `accountList` when it's a Set | Wrong data structure in name | `accounts` (just use plural) |38| `processData_v2` | Version control in names | Use version control, not naming |39| `getUser()` that also logs and caches | Name doesn't reveal side effects | `fetchAndCacheUser()` or split |40| `isEnabled` that modifies state | Query name hides a command | Separate query from mutation |4142### Names That Don't Try4344| Antipattern | Problem | Fix |45|-------------|---------|-----|46| `data`, `info`, `item`, `thing` | Generic to the point of meaningless | Use domain-specific terms |47| `tmp`, `val`, `x` beyond tiny scope | Forces reader to track mentally | `currentTemperature`, `retryCount` |48| `manager`, `handler`, `processor` | Vague role descriptions | Describe *what* it manages |49| `utils`, `helpers`, `misc` | Grab-bag namespaces | Group by domain or operation |5051### Names That Mislead5253| Antipattern | Problem | Fix |54|-------------|---------|-----|55| Inconsistent casing | Readers assume variables are lowercase | Follow language conventions exactly |56| Abbreviations (`usrRepo`, `passwd`) | Ambiguous unless universally known | Spell it out: `userRepository`, `password` |57| Noise words (`UserData` vs `UserInfo`) | Indistinguishable without reading code | Pick one and be consistent |58| Negated booleans (`isNotActive`) | Double negatives in conditions | Use positive: `isActive` |5960### Names That Over-Specify6162| Antipattern | Problem | Fix |63|-------------|---------|-----|64| Hungarian notation (`strName`, `iCount`) | Type system already encodes types | Just `name`, `count` |65| Gratuitous prefix (`GSDAccountService`) | Every class in app has same prefix | Use namespaces/packages |66| `AbstractBase` + `Impl` suffix | Naming the pattern not the concept | `UserService` + `DefaultUserService` |6768## Decision Checklist6970- [ ] Name reveals intent without needing a comment71- [ ] Name uses domain vocabulary where applicable72- [ ] Name follows language/project conventions73- [ ] Name is distinguishable from similar names nearby74- [ ] Boolean names read as yes/no questions75- [ ] Function names describe the action (verb phrases)76- [ ] Class names describe the thing (noun phrases)77- [ ] No abbreviations unless universally understood (`URL`, `HTTP`, `API`)7879---80> Converted and distributed by [TomeVault](https://tomevault.io/claim/smileynet) — claim your Tome and manage your conversions.81<!-- tomevault:4.0:skill_md:2026-04-14 -->