Units/Data Formats in Names
“Units” and “data formats” are subtle, but very important, aspects of naming. Since this information can be so critical to code correctness, it’s worth special attention.
In some cases, a variable may need to hold values that could encompass many units or data formats, or adding specific units could result in excessively long names. In those cases, you may have to leave the variable name fairly generic (for accuracy) and let documentation fill in the gap with additional details to balance the trade-offs. However, those should be rare, more exceptional cases. Because mistakes in this area can cause serious bugs and impair understanding, it’s usually best to embed unit/data format information in variable names themselves. The following sections show how to do so: