DEV Community

Idan Arye
Idan Arye

Posted on

Analogical naming - yay or nay?

I'm working on a project and struggling with one of the two hard things - naming things. I have names - but I don't really like them (the most descriptive names I could find for the two main roles only differ in a single letter)

When I picked a name for the project itself, I used an analogy to fantasy adventures. The software itself is not related to the fantasy genre, but I'm starting to think about using the same analogy to name some of the major components and processes in my architecture.

But I'm still not sure about this. It was fine for naming the project itself - projects need unique and memorable names - but the names inside the project should be as descriptive as possible, to aid readers who need to understand what does what. Not that I suggest arbitrary naming - I have a clear and concise analogy and I'm not going to just pick a random fantasy term for every software term that needs to be named - but I still fear it may look unprofessional to have classes named Adventurer or Wizard or GuildHall...

Should I go for it?

Oldest comments (7)

Collapse
 
evanoman profile image
Evan Oman

My opinion would be nay. I think keeping track of analogies and coming up with new ones will drain mental energy that could be used to improve or understand the code.

If your domain includes guilds or adventurers or wizards then I would include them, otherwise stick to descriptive names and don't overthink them.

Collapse
 
ahferroin7 profile image
Austin S. Hemmelgarn

For a project as a whole? Sure, I do that regularly these days (albeit usually by coming up with the first descriptor that comes to mind for the project, then translating that and romanising the result (coincidentally, this is also how I come up with names for characters in tabletop RPG's)).

For the internals of the project? Absolutely not. Naming is hard enough as it is when you're using simple descriptive names. Adding analogies in there just complicates things.

Collapse
 
marvelouswololo profile image
MarvelousWololo

Is the project about naming things? (I'm not being rude this a honest question, sorry to disrupt the main thread)

Collapse
 
idanarye profile image
Idan Arye

I'm not really sure what it means for a project to "about naming things"...

Collapse
 
marvelouswololo profile image
MarvelousWololo

what the project is about? what the instructor asked you to do? is naming being evaluated or you just have to give some non-terrible names to your vars?

Thread Thread
 
idanarye profile image
Idan Arye

This is a personal project, not a school assignment. I'm not going to be graded for the names I pick.

Thread Thread
 
marvelouswololo profile image
MarvelousWololo

oh i see. so it was just a tangent question. awesome. thanks!