Naming

22/09/2024

A grammar of naming should lay out the categories of reasons for judging whether a name is appropriate or not:

A name communicates.

- Communication, depth. Does the name communicate well to a developer who wants to change a specific behaviour of the class or method?

- Communication, breadth. Does the name scan easily? For a developer who wants to quickly understand a class or method at a high level.

A name asserts an identity.

- Ability to accommodate change. Does the name continue to apply when you extend the code to other use cases within the same problem domain?

- Ability to prevent unwanted change. Does the name communicate a certain constraint that a developer changing the code should be aware of?