A nice little reminder that clarity is not the same as verbosity. Also has some concrete tips for removing unnecessary verbosity in names, complete with examples. Though in some contexts, I might prefer a name like employeeToRole for a Map<Employee, Role> over the article’s employeeRoles.

  • jbrains@sh.itjust.works
    link
    fedilink
    arrow-up
    6
    ·
    18 days ago

    I have settled into this pattern:

    1. Name expands as I understand better the structural role of a thing. Duplication in names begins to become easier to spot.
    2. Removing duplication in names means introducing helpful structures, resulting in shortening names again, particularly as the intent/purpose of thing becomes clearer.

    Long names stay unnecessarily long when we don’t notice the patterns that suggest the missing structures.

    The more examples of this kind of thing, the better!

    (And my preferred name for that is rolesByEmployee. In general, “values by key”.)