Document Rationale for Levels of Flexibility [DP8] [WHY]

Document Rationale for Levels of Flexibility [DP8] [WHY]

Tip DP8

Variables can be populated across a spectrum of different levels of flexibility: hardcoded, read form a file, fetched across a network, input by a user, etc. How flexible or customizable something is has trade-offs affecting complexity or feature-richness. If the rationale might not be obvious, document why a particular approach was chosen.

This ensures that any additional complexity or lack of customization is understood, helping keep the code as simple as possible while preserving correct behavior under future maintenance.

See the following example:

The example above demonstrates comments on why some level of customizability is in the code but why another level of customizability is not.

Deep coding during work hours ad.png