Topic: code-quality
-
Naming identifiers so that code reads as intent
Choose names that state what a thing is or does in the domain's vocabulary, at a length proportional to its scope; avoid encodings, abbreviations and misleading types, and rename as understanding improves.
-
Naming identifiers: by role, in domain vocabulary, as long as their scope
A name says what a thing is or does in the problem domain, not what type it has or how it is implemented. Length grows with scope, a concept gets exactly one word, booleans read as statements, and collections are plural. Language conventions (PEP 8, Effective Go) take precedence over personal taste, and renaming is cheap as long as it is done with tooling and in its own commit.
Machine-readable: JSON