Should I use consistent PascalCase and camelCase names when prompting AI?
Asked by
MellowPine47
I'm an experienced programmer but relatively new to using AI for development. For a .NET MAUI project targeting mobile and desktop, I'm wondering whether it helps to consistently name concepts with identifiers such as `CarScrollView` instead of describing them in different ways, like "the scrolling window of cars" or "the car menu."
Do AI coding tools generally perform better when I use PascalCase or camelCase names for components, actions, and other project concepts, or is ordinary natural-language description usually sufficient? I'm also interested in whether conventions are better kept in prompt text, project documentation, or configuration files. I may use an Anthropic model through Visual Studio, but I haven't chosen a specific tool yet.
Answers
Precision matters more than whether the wording is PascalCase or conversational. Saying โuse a `HashSet` for unique valuesโ is much better than saying โuse a thing that stores stuff,โ because the technical term carries concrete constraints. Establish names when they matter, but donโt force artificial names for ideas that havenโt become actual parts of the design yet.
Reply to this answer
Put durable conventions in project documentation or instruction files rather than repeating them in every prompt. A file describing the architecture, naming rules, design system, and expected workflow gives the AI stable context and keeps individual prompts shorter. Natural language is fine there too; identifiers are mainly valuable when they map to real code concepts.
Reply to this answer
Natural language generally works well as long as you provide enough context. You donโt need to name every component in advance, and the model can usually settle on sensible naming conventions itself. One thing to watch for is overloaded terminology: if you call something an MVP or โphase one,โ it may start adding those words to unrelated names throughout the code.
Reply to this answer
Consistency is useful once a concept has been established. If `CarScrollView` always refers to the same component, the AI has less ambiguity to resolve and is less likely to invent alternate names. The savings and accuracy boost probably wonโt be dramatic, thoughโthe bigger improvement comes from giving clear requirements and correcting bad assumptions.
Reply to this answer
Use exact identifiers when you already have a specific type, table, column, endpoint, or component name that must be preserved. Otherwise, just explain the behavior in normal language. The most effective prompts tend to include precise, testable requirements, constraints, examples, wireframes, or mockupsโsimilar to how you would brief a capable junior developer.
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions