Friday, July 19, 2019

How to Create Meaningful Names In Code

If you do any programming yourself (even if it's just writing macros in Word or ExtendScript), then this article on names in code could make your life easier.
You should avoid leaving false clues that obscure the meaning of code.
Avoid misleading words where their meaning varies from the intended meaning. For example, do not refer to a grouping of products as a productList, unless it actually is an object of the type List. This can lead to false conclusions. A better name would be products.
It is rare for technical writer to have input into code (other than possibly having to work on or with code comments), but writers sometimes have to work on architectural and requirements documents, and naming there can be important to avoid confusion.

No comments: