Variable and Function Naming Candidates

Describe what your code does and compare naming options before choosing.

Prompt · 3 variables

You are a seasoned developer with extensive code review experience, especially around naming conventions. Instead of picking a single "best" name, please provide several candidates and compare how each one reads.

I am working in {{target language}}, and the current identifier name is {{existing name}}. I want a teammate opening this file for the first time to immediately understand what this code does.

Based on the description below, please suggest 5 naming candidates. Rather than offering 5 minor variations of the same name, provide 5 distinct angles based on what each name emphasizes.

Format the response as a markdown table with the columns: "Candidate | How it reads at first glance | When it becomes awkward or misleading". Below the table, recommend the best option and explain why in two sentences. Finally, add a single-line note indicating if there is any scenario where keeping the current name is actually preferable.

For example, if the description is "Checks whether an order can be cancelled", distinct candidates might look like `canCancelOrder` (emphasizes a boolean check), `validateOrderCancellation` (implies an assertion or validation workflow), and `checkOrder` (too vague about what is being checked).

Follow the standard naming conventions of {{target language}}. Do not use abbreviations that might be unclear to a team (e.g., mgr, tmp, proc). Do not include behaviors in the name that are not present in the description.

Function/Variable Description: """ {{job role description}} """

Copy, then paste here · ChatGPT and Claude open with the prompt filled in Open in ChatGPT ↗Open in Claude ↗Open in Gemini ↗ Edit in builder Download classroom card

Some variables here may contain personal data. Replace real names, numbers and company names with placeholders.

Why it is written this way

Role
You are a seasoned developer with extensive code review experience, especially around naming conventions. Instead of picking a single "best" name, please provide several candidates and compare how each one reads.
Context
I am working in {{target language}}, and the current identifier name is {{existing name}}. I want a teammate opening this file for the first time to immediately understand what this code does.
Task
Based on the description below, please suggest 5 naming candidates. Rather than offering 5 minor variations of the same name, provide 5 distinct angles based on what each name emphasizes.
Format
Format the response as a markdown table with the columns: "Candidate | How it reads at first glance | When it becomes awkward or misleading". Below the table, recommend the best option and explain why in two sentences. Finally, add a single-line note indicating if there is any scenario where keeping the current name is actually preferable.
Example
For example, if the description is "Checks whether an order can be cancelled", distinct candidates might look like `canCancelOrder` (emphasizes a boolean check), `validateOrderCancellation` (implies an assertion or validation workflow), and `checkOrder` (too vague about what is being checked).
Constraints
Follow the standard naming conventions of {{target language}}. Do not use abbreviations that might be unclear to a team (e.g., mgr, tmp, proc). Do not include behaviors in the name that are not present in the description.
Input
Function/Variable Description: """ {{job role description}} """

When asking AI for naming suggestions, it usually returns a single name. While it might sound reasonable, it lacks the context of why it was chosen and what alternatives were considered, making it hard to align with team standards. Naming isn't about finding a single correct answer—it's about choosing what intent to emphasize. Without comparisons, making an informed choice is difficult.

Enforcing a Format via a structured table is the core of this prompt. The column "How it reads at first glance" forces the AI to focus on a reader's impression rather than the author's intent. The column "When it becomes awkward or misleading" weeds out names that work today but break as soon as the feature expands slightly (e.g., fetchUser when it starts reading from a cache).

Providing an Example prevents vague interpretations of "different angles." Without examples, the AI tends to generate nearly identical names like getX, getXData, and getXInfo. Demonstrating distinct naming directions sets a baseline for genuine variety.

Strict Constraints prevent two common pitfalls: without language conventions, Python code might get camelCase names like getUserList, and without banning abbreviations, lazy names like procMgr creep in. Constraining the AI to "only include behaviors explicitly described" is crucial—hallucinating unperformed actions like andSendEmail causes significant readability issues down the road.

Unfamiliar terms? See Aha AI: prompt, output-format

Compared with a bad example

Common bad example

What is a good function name for calculating the final cart total?

You will simply get calculateTotalPrice. While decent, the name fails to reveal that it filters out out-of-stock items or applies discount coupons. Without alternatives to compare, developers adopt it blindly, only to re-read the implementation months later wondering, "Why is the total different from the subtotal?"

Variations

When naming files or directory paths

When naming files or directory paths

I need to determine the file name and folder path for a new module in a {{target language}} project. Based on the description below, suggest 3 candidates and describe the folder structure each candidate assumes in one sentence. Highlight any risk of confusion with commonly used naming patterns.

""" {{job role description}} """

Use this when structuring code organization rather than standalone identifiers. Explaining assumed directory layouts helps evaluate alignment with project architecture.

When reviewing multiple names at once

When reviewing multiple names at once

Below is a list of {{target language}} identifiers from a single file. First, evaluate each name as "Keep | Refactor". For those marked "Refactor", provide 2 candidate names and the reasoning in a table. Finally, summarize any inconsistencies in naming patterns across the file.

""" {{job role description}} """

Ideal for bulk renaming during refactoring. Requiring a triage step prevents unnecessary changes to names that are already clear.

Model notes

Pasting a few commonly used names from your team's codebase helps the model generate candidates that match your existing conventions.

If you ask for new candidates without guidance, models tend to produce minor variations of previous suggestions. Instead, pick one direction you like and ask: "Give me five more variations focusing exclusively on this angle." Pasting 5–6 existing naming examples from your codebase helps match your team's conventions.

Related prompts

Last updated 2026-09-02 · Found a mistake? Let us know