The Compiler Ignores Your Variable Names. Humans Don’t.
When code compiles, your carefully chosen variable names get stripped away. The CPU sees memory addresses and register values. It has no idea whether you called something userAccountBalance or x. From the machine’s perspective, those are identical.
From your colleague’s perspective, they are not identical at all.
Naming is where most of the actual thinking in programming lives, and it gets less attention than almost any other craft element. Here’s why it matters more than most engineers act like it does.
1. Bad Names Are Technical Debt You Can’t Measure
Technical debt gets talked about in terms of architecture, test coverage, dependency versions. Nobody files a ticket for “we have 200 functions with names like handleData and processStuff.” But that vagueness compounds over time in ways that are genuinely expensive.
When a name doesn’t tell you what a variable holds, you have to trace backwards through the code to figure it out. Every time. That’s not a one-time cost. If five engineers touch a function monthly and each spends three extra minutes on orientation because temp2 doesn’t communicate anything, that’s real time gone. Multiply it across a codebase of any real size and the number becomes meaningful.
The reason this debt is hard to measure is that the cost shows up as slow reading, extra questions in code review, and bugs introduced by wrong assumptions. None of those get attributed to the variable name. They get attributed to the engineer who made the mistake.
2. A Good Name Is a Tiny Specification
When you name something well, you’re encoding a contract. retryCount tells you the variable is an integer, it’s incrementing, and there’s a retry loop somewhere. maxRetryAttempts tells you it’s a ceiling. These two names constrain the reader’s mental model immediately, before they read a single line of the surrounding logic.
This is the same principle behind what production bugs are actually telling you about your tests: behavior that isn’t captured somewhere explicit will eventually surprise you. A well-named variable is a form of inline documentation that can’t go stale, because it lives right next to the thing it describes.
The practical test for a name: can someone read it in isolation and make reasonable assumptions about what values it holds, what units it uses, and roughly what it’s for? If the answer is no, the name is doing less than it could.
3. Ambiguous Names Force Readers to Hold More State
Working memory is finite. When a reader encounters data, info, or result in a function, they have to keep tracking what that thing actually is as they read further. Every unnamed or vaguely named variable adds cognitive load that has to be carried until the function ends or the variable goes out of scope.
Good names offload that tracking. parsedInvoiceLineItems doesn’t require you to remember what it was initialized to. The name does the work. This isn’t about elegance or aesthetics. It’s about how much mental effort is required to read code correctly, which directly affects error rates.
This is why code review often catches fewer bugs in dense, vaguely named functions. Reviewers are spending cognitive budget on understanding what things are, leaving less capacity for evaluating whether the logic is correct.
4. Naming Reveals Muddled Thinking
If you can’t name something precisely, that’s usually a signal that you don’t fully understand what it is. A function called handleUserStuff probably does too many things. A variable called flag is hiding a decision that should be explicit.
Forcing yourself to name things well is a debugging tool for your own understanding. When you sit down to write const x = getUserData() and try to rename it properly, you might discover you’re not sure whether it’s returning a user object, an array of users, or just a subset of user fields. That confusion exists in the code whether you name it clearly or not. The bad name just lets it hide longer.
Engineers who write precise names tend to write more modular code, not because naming forces modularity, but because the thinking required to name things well surfaces design problems early. The name is a symptom. The clarity behind it is the goal.
5. AI-Assisted Coding Raises the Stakes, Not Lowers Them
A reasonable counterargument goes like this: with good autocomplete and LLM-assisted coding, you can ask the tool what a variable does. Why invest in naming when the AI can explain it?
This gets it backwards. AI coding tools work by predicting what you probably mean based on context. Vague names produce vague context, which produces suggestions that are statistically plausible but semantically wrong. A function full of temp, data, and result gives a model very little to work with.
Precise names are a form of specification that both human readers and AI tools can use. If anything, the rise of context-aware coding tools makes naming more important, because those tools are pattern-matching against your variable names to infer intent. Garbage in, garbage out applies to the context you give your AI tools just as much as to any other input.
6. Conventions Compound, and So Does Inconsistency
One bad name in a codebase is a minor annoyance. A codebase where naming conventions are inconsistent is a tax on every engineer who works in it. When some booleans are prefixed with is and some aren’t, when some timestamps are in milliseconds and some aren’t and neither the name nor the comment tells you which, you end up with a reading environment where you can’t trust your assumptions.
This is the harder problem to fix, because it’s not just about individual naming choices. It’s about a team establishing and actually following shared conventions. The payoff is substantial: a codebase with consistent, precise naming lets engineers move faster because they can read code in chunks rather than word by word. That’s not a soft benefit. It’s the difference between engineers who are slow for the right reasons and engineers who are slow because the codebase is fighting them.
The compiler really doesn’t care. Your future self does. Name accordingly.