Everyone has heard the old joke that there are two hard things in programming.

  • Cache Invalidation
  • Naming things
  • Off by one errors

This doesn’t have to be the case though. I currently am employed at a magazine company and was tasked with re-doing how we create magazines from the ground up. Each month our magazines have an issue go out, and an issue of course has many articles. Additionally, every issue has a few things that are in all issues, things like the cover, the table of contents, and a list of contributors. How we represent these in our data model is as a json object for each of them, so they all live together in one table. The hard part though was what to call them.

I put a lot of thought into it, trying to figure out the best word for their name. I thought of words like basic, every, always, and foundation. I knew the word I was looking for was something along these lines, but none of those words were a perfect fit for what I needed. Basic was close but not elegant sounding enough. Always and every were in the right category of words, but aren’t nouns. Foundation is alright but as we use foundation for styling, we didn’t want to run into problems when talking about things. I was about to give up and just call these things basics when I had an idea, use a thesaurus.

A thesaurus is generally thought of as a writer’s tool, not a programmer’s, but there’s nothing that says we can’t use it too. After a couple minutes of searching thesaurus.com, clicking on all the words that sounded close to what I want, as well as looking at antonyms for things that might help summon the word to my tongue I found the word I wanted, “Essential”. Covers, and table of contents are essential parts of a magazine, the word sounds fancier and more sophisticated than “Basic”, a perfect fit for the task at hand. I may have found the word on my own after spending a lot more time thinking, or perhaps I would have given up and kept a word that conveyed what I needed, but wasn’t a perfect fit. In the end, we made the table, and had a wonderful name for our things that were hard to talk about before. So next time you find naming things to be hard, try opening a thesaurus!