Use visually distinct identifiers to eliminate errors resulting from misrecognizing the spelling of an identifier during the develoment and review of code. Depending on the fonts used, certain characters such as:
- '1' (one) and 'l' (lower case L)
- '0' (zero) and 'O' (capital o)
are visually similar or even identical.
Do not define multiple identifiers which only vary with respect to one or more visually similar characters.
When using long identifiers, try to make the initial portions of the identifiers unique for easier recognition. This also helps prevent errors resulting from non-unique identifiers DCL32-C.
References
- ISO/IEC 9899-1999 5.2.4.1 Translation limits
- MISRA 04 Rule 5.1