this post was submitted on 18 Aug 2023
26 points (100.0% liked)

Experienced Devs

125 readers
1 users here now

A community for discussion amongst professional software developers.

Posts should be relevant to those well into their careers.

For those looking to break into the industry, are hustling for their first job, or have just started their career and are looking for advice, check out:

founded 1 year ago
MODERATORS
 

Domain-driven design includes the idea of a "ubiquitous language" where the engineers and the domain experts and the product owners come together and agree on terminology for all the domain concepts, and the project then uses that terminology everywhere.

But on the projects I've been involved with, much more common is a situation where the requirements docs mostly use one term but sometimes use a different name for the same thing because the docs were worked on by two people who disagreed on the terms, the designers decide they don't like how the words look so the UI calls the concept something else, the database developer reverses the term's word order to fit their personally-preferred schema naming conventions, the API designer invents a compound name that includes both the UI and the database names, and so on. (I only barely exaggerate.) Which names map to which other names becomes tribal knowledge that's usually not written down anywhere.

This kind of thing bugs me a lot, but I seem to be in the minority. I recognize that it makes very little functional difference, but it just feels sloppy to me and I don't like having to remember multiple names for things. I will usually advocate for renaming things in the code for consistency, and other people on the team will almost always agree that it's a good idea and will happily accept my PRs, but I'm usually the only one taking the initiative.

So, my question to you fine folks: am I wrong to care much about this? Do you think using consistent names for domain concepts across the board actually makes a meaningful difference in terms of code maintainability and discoverability? Or is the effort required to keep the names consistent over time actually greater than the mental overhead of working with the inconsistent names?

top 7 comments
sorted by: hot top controversial new old
[–] wesker@lemmy.sdf.org 8 points 1 year ago

You're not wrong to be bothered. Consistent naming is necessary for clear communication, especially since there is often so much abstraction in our line of work.

It does become difficult though when working cross-team or cross-service, because there may be overlap in terminology. You just have to do your best. In these situations, sometimes it helps to create a sort-of "glossary" for reference when needed.

[–] TomMonkeyMan@chinese.lol 4 points 1 year ago

you're right, bro. It's not just about naming consistency; understandable naming, not gibberish, is also very important. That is the key to precise communication. In my company, we are not allowed to use abbreviations to avoid causing any misunderstandings.

[–] sjpwarren@programming.dev 4 points 1 year ago

Consistency is very important espcially later on. When the user or client is talking about X and it's called Z in the Database and Y in the code this will cause so much confusion. I think the fact you care means you are good programmer. Don't loose that.

[–] Hector_McG@programming.dev 3 points 1 year ago

Is having a consistent domain language across the board important? Yes, obviously it’s a huge benefit in communication and in maintainability.

Is not following that convention, in and of itself, a huge problem? Probably not, so long as the primary parties understand the differences between separate aspects (such as the database using a different word order), although the documentation needs to explain this.

Is not being able to get an agreement on a consistent domain language that everyone will follow a problem for development? Yes. Huge. Crippling. It reeks of poor, indecisive management at the top project level, and petty interdepartmental squabbling all the way down. It’s a huge red flag as to a company’s ability to deliver. It’s not that difficult a thing to get agreement on or to enforce, as it’s entirely visible. If a project can’t do that, it’s not going to be able to do the things that are actually difficult.

[–] Lmaydev@programming.dev 2 points 1 year ago

We recently had this issue at work with the term tenants.

We had tenants as in guests, tenants as in multi tenant backend and aad tenants.

It was beginning to get very confusing when talking about them so we sat down and came up with a list of terms we all agreed on.

I think it really depends on how the company is organised and who is working closely together as to whether it makes a big difference.

Different teams can use different names as long as they know what the others are meaning.

[–] buxton@programming.dev 1 points 1 year ago

Anything to do with naming is going to be doomed to bike shedding (https://en.wikipedia.org/wiki/Law_of_triviality). The only way to avoid the kind of problem you mention is to have one person come up with all the naming rules and to enforce it.

You're right to think it's important because it'll make maintenance significantly easier than having 3-4 disparate naming schemes. However, there's no way that you can get a group of people to agree on a single naming scheme. Everyone will have their own idea which will make complete sense to them but to no one else, and they'll argue for hours about this. There's no easy solution, even though it should be trivial.

[–] Kissaki@programming.dev 1 points 9 months ago

It is warranted, and your colleagues seem to agree.

and other people on the team will almost always agree that it’s a good idea and will happily accept my PRs

I think you may be misinterpreting what is happening.

Them not taking initiative does not correlate to its importance. It’s just that most people don’t take initiative - or at least here, evidently, for naming consistency.


How much of an issue ambiguous naming is or may become depends on context - on a lot of things. But ambiguity in naming, just like elsewhere, weakens certainty and reasonability. If you can define and keep clear terminology, then always do so.