/
Giving Literal Values Names
Giving Literal Values Names
Values in code sometimes come dynamically at runtime from sources outside of the code itself (ex. user input). Those have to be stored in some kind of variable. However, many values - numbers, text, etc. - often can be hardcoded in the code itself. When this happens, such values are called literals - they are “literal” textual representations of some value in code.
First step is recognizing that these values don’t have to be used as literals all throughout source code. Usage of literals can often be cryptic. You can instead give literals name to communicate greater understanding, as discussed in the following sections:
, multiple selections available,
Related content
Crafting Variable Names for Maintainability
Crafting Variable Names for Maintainability
More like this
Giving Names to the Unnamed
Giving Names to the Unnamed
More like this
The Importance of Variable Naming
The Importance of Variable Naming
More like this
Giving Complex Expressions Names [VU4]
Giving Complex Expressions Names [VU4]
Read with this
Naming Accuracy
Naming Accuracy
More like this
Document Values with Special Meanings [DI30]
Document Values with Special Meanings [DI30]
More like this