Skip to content
·7 min read

Naming Conventions Making AI Code Readable Tutorial

How to enforce naming conventions that make AI generated code readable, the four naming patterns, and what AI defaults look like

Share

Naming conventions for AI generated code matter because AI generates plausible names that often miss meaning. Four naming patterns transform AI code from technically correct to readable: descriptive over generic, consistent verb prefixes for functions, plural nouns for collections, and meaningful boolean prefixes (is, has, can). Adding these to CLAUDE.md and code review produces code that future you and team members can understand without reverse engineering.

This tutorial walks through the four naming patterns, what AI defaults look like, how to enforce conventions, and the four mistakes builders make with naming.

Why Naming Matters Specifically For AI Code

Naming matters specifically for AI code because AI generates code volume faster than humans can review carefully. Bad names accumulate at AI scale; accumulation makes code unreadable.

The 2026 reality is that AI generated names are often technically correct (data, item, thing, value) but semantically empty. Empty names produce code that requires reading implementation to understand intent.

Key Takeaway

A 2025 code readability study of 200 vibe coded projects found that projects with enforced naming conventions had 52 percent faster code review times than projects without conventions. Naming clarity measurably affects review and maintenance speed.

The pattern to copy is the way medical professionals use precise terminology. "Patient experiencing acute thoracic discomfort" beats "patient feeling chest pain" for clinical communication. Code naming follows the same principle; precise names communicate intent.

The Four Naming Patterns That Matter

Four patterns transform AI naming defaults.

Pattern 1, descriptive over generic. "userEmail" beats "data". "calculateMonthlyRevenue" beats "compute". Specific names communicate intent.

Pattern 2, consistent verb prefixes for functions. "get" for retrieval, "set" for assignment, "is" for booleans, "handle" for events. Consistency aids recognition.

Clean modern flat infographic on light gray background. Top center bold black title text: FOUR NAMING CONVENTION PATTERNS. Below title, four equal sized colored rounded rectangle cards arranged horizontally. Card 1 blue: large bold text PATTERN 1 then smaller text DESCRIPTIVE NAMES. Card 2 green: large bold text PATTERN 2 then smaller text VERB PREFIXES. Card 3 orange: large bold text PATTERN 3 then smaller text PLURAL COLLECTIONS. Card 4 purple: large bold text PATTERN 4 then smaller text BOOLEAN PREFIXES. Single footer line below cards in dark gray text: TRANSFORM AI DEFAULTS. Nothing else on canvas. No text outside cards or below cards.
Four naming convention patterns that transform AI generated code from technically correct to genuinely readable. Each pattern addresses different naming failure; combined they make AI code understandable without reverse engineering implementation.

Pattern 3, plural nouns for collections. "users" for array, "user" for single. Plurality matches data shape.

Pattern 4, boolean prefixes (is, has, can). "isLoading", "hasPermission", "canEdit". Prefix immediately communicates type.

What AI Default Names Look Like

AI defaults follow predictable patterns that produce readability problems.

Default 1, generic placeholder names. data, item, thing, value, result. Names mean nothing without context.

Apply naming conventions

Browse more ship articles

Read more ship

Default 2, inconsistent verbs. "getUser" in one file, "fetchUser" in another, "loadUser" in third. Inconsistency forces recognition every time.

Default 3, ambiguous singular plural. "user" sometimes single, sometimes array. Ambiguity produces bugs.

Default 4, missing boolean prefixes. "loading" instead of "isLoading", "permission" instead of "hasPermission". Missing prefix obscures type.

How To Enforce Each Pattern

Three enforcement approaches make conventions stick.

Enforcement 1, document conventions in CLAUDE.md. AI reads conventions; conventions shape generation.

Enforcement 2, ESLint rules for naming. eslint-plugin-naming-convention enforces patterns; CI catches violations.

Enforcement 3, code review checklist for naming. Human reviewers catch conventions ESLint cannot enforce.

What Makes Naming Conventions Sustainable

Three patterns separate sustainable naming from temporary discipline.

Clean modern flat infographic on light gray background. Top title bold black: THREE NAMING SUSTAINABILITY PATTERNS. Single vertical numbered list with three rows. Row 1 blue badge CONVENTIONS IN CLAUDE MD with subtitle AI READS AND APPLIES. Row 2 green badge ESLINT ENFORCES MECHANICS with subtitle CI BLOCKS VIOLATIONS. Row 3 orange badge REVIEW CATCHES SEMANTIC with subtitle MEANING NEEDS HUMANS. Footer text dark gray: SUSTAINABILITY THROUGH LAYERS. Each label appears exactly once. No duplicated text.
Three patterns that make naming conventions sustainable in vibe coded projects. Conventions in CLAUDE.md, ESLint enforcement, and review for semantics all matter; without these, naming drifts as code volume grows.

Pattern 1, conventions in CLAUDE.md. AI reads; AI applies. Conventions shape default generation.

Pattern 2, ESLint enforces mechanics. Mechanical patterns (case, prefixes) enforced automatically.

Pattern 3, review catches semantic. Meaning correctness needs human judgment; review fills the gap.

The combination produces sustainable naming. Without these patterns, naming drifts.

How To Improve Existing Code Naming

Three patterns help improve naming in existing codebases.

Pattern A, rename during refactoring. When touching code for other reasons, improve names. Spreads work over time.

Pattern B, rename worst offenders first. Most confusing names first; impact prioritization.

Pattern C, use IDE rename refactoring. IDE tools handle rename across files safely; manual rename produces bugs.

Common Questions About Naming Conventions

Naming conventions raise questions worth addressing directly.

The first question is whether to use camelCase or snake_case. Match language convention; JavaScript uses camelCase; Python uses snake_case. Match expectation.

The second question is whether to use Hungarian notation (str_name, int_count). No; modern languages have type systems. Hungarian notation adds noise without benefit.

The third question is whether names can be too long. Yes; over 30 characters becomes unreadable. Find balance between specific and concise.

The fourth question is whether AI tools follow naming conventions. With prompting yes; without prompting AI defaults to generic names.

How Naming Affects Codebase Maintainability

Naming affects codebase maintainability in compounding ways. Maintainability effects compound across project lifetime.

The first compounding effect is debug speed. Clear names speed debugging; debug compounds across all bugs.

The second compounding effect is onboarding speed. Clear names speed onboarding; new contributors productive faster.

The third compounding effect is refactoring confidence. Clear names enable safe refactoring; refactoring keeps code clean.

The combination produces maintainability that compounds. Without naming attention, maintainability degrades.

How To Train AI For Better Naming

Three patterns train AI to produce better names.

Pattern A, explicit examples in CLAUDE.md. Show good and bad name examples; AI learns by example.

Pattern B, naming context in prompts. "Use descriptive function names that tell readers what the function does without reading implementation."

Pattern C, request name review during generation. "After generating, review names; rename anything that requires reading implementation to understand."

The combination produces AI generated names matching conventions. Without prompting, AI defaults to generic names.

Common Mistake

The most damaging naming mistake is accepting AI default names without review. AI defaults are technically correct but semantically empty; accepting them accumulates readability debt. The fix is to review every name during code review; rename anything generic. Builders who review names produce readable code; builders who accept defaults produce code that requires reverse engineering.

The other mistake is over abbreviating. Short names save typing; long names save reading. Reading happens more than typing.

A third mistake is inconsistent conventions across files. Pick conventions; apply universally. Inconsistency forces recognition overhead.

A fourth mistake is missing the rename opportunity during refactoring. Refactoring is renaming opportunity; opportunity compounds across refactors.

What This Means For You

Naming conventions for AI generated code transform technically correct code into genuinely readable code. The four patterns, AI defaults, and enforcement approaches produce naming that compounds maintainability.

  • If you're a senior dev: Add naming conventions to your team's CLAUDE.md; conventions shape all AI generation.
Build naming discipline

Browse more ship articles

Read more ship
PJ
Pranay Joshi

20+ years building products at scale. VP of Product & Engineering, startup founder, and AI coach. Helping dreamers turn ideas into reality with vibe coding.

The Tuesday Shipping Report

Every Tuesday, one focused email:

  • - The tool or technique that's actually working right now
  • - A real problem from the community (and how to solve it)
  • - What changed this week in the vibe coding landscape

Read by 1,000+ founders, developers, and creators building with AI. Free forever. No spam.