Naming Optimization Problem

Naming is an optimization problem with uniqueness as the constraint and communication as the objective function. Uniqueness is easy enough to achieve; just include a guid. Naming is impossibly hard because it involves communication.

linkUniqueness vs communication

That communication is hard is no revelation. Instead, I find it helpful to be aware of the tension between uniqueness and communication when picking names. A newly generated guid would be unique, but it communicates a minimal amount of information. That is enough information for computers, but humans work better with more.

Uniqueness need not be an absolute constraint. It might suffice for uniqueness to hold within a particular scope. That is the theory behind namespaces.

linkExample: Git

The commits in a git repository are a good example to consider. Each commit includes a hash, which is 40 characters long and appears random. Thus, hashes are unique names for commits that computers effortlessly use to find commits. Each commit also includes a commit message, which is typically written by a human. They are typically unique, but not completely.

I prefer to read commit messages when combing through commits. If necessary, I double check the commit I found by comparing hashes. The commit message "initial commit" not only communicates the existence of a commit but also the reasonable assumption that this is the message of the first commit. On the other hand, a hash only communicates the existence of a commit.

linkSummary

Naming is an optimization problem with uniqueness as the constraint and communication as the objective function. When selecting your next name, consider the tension that exists between uniqueness and communication.


linkTags

The tags feature of Coding Blog Plugin is still being developed. Eventually the tags will link somewhere.

#reference

linkComments

Uniqueness vs communicationExample: GitSummaryTagsComments

Home About Archive