Documenting Return Values [DI21] [WHAT]

Documenting Return Values [DI21] [WHAT]

Tip DI21

Return values are a form of data similar to variables, so many variable-documentation considerations apply to them as well. However, while some programming languages may support “named” return values, many do not, so there’s less information from the code itself as to the meaning of a return value. Therefore, it is very important to ensure return values are well-documented to fully convey their meaning/usage considerations.

See the following examples:

Deep coding during work hours ad.png