/
Naming Accuracy

Naming Accuracy

Variable names must be accurate to successfully communicate understanding to readers. If a variable name doesn’t accurately reflect what the variable is supposed to represent, something might be communicated to a reader, but it won’t be what the code is doing or intended to do.

Inaccurate variable names can communicate no actual understanding or wrong understanding. Neither is good, so aim to make your names accurate. Articulate what the variable represents in words (either out loud, in your head, or written down), and then use those words as the basis for a good variable name.

The following sections contain more specific tips on what to do or not do when it comes to variable naming accuracy:

Related content