Do you avoid micro-culture jargon and insider terms?

Last updated by Tiago Araújo [SSW] about 1 month ago.See history

Code that relies on nicknames, abbreviations, or internal jokes can create unnecessary obstacles for new team members or future collaborators. Terms that only make sense to the “in-group” (like a specific project team or company department) can be hard to interpret, causing frustration and slowing down onboarding.

Instead, favor widely understandable names or domain-specific terms that reflect a shared understanding of the business or domain.

How this differs from ubiquitous language?

Using ubiquitous language) is about naming concepts in ways that align with terms used by domain experts and stakeholders. While this might seem like micro-culture jargon at first glance, it’s different for an important reason. Unlike insider terms, ubiquitous language refers to widely recognized ideas within the domain, making code clearer for anyone familiar with the field.

Avoid in-grouped terms that don’t convey meaning to people outside the team, even if they seem descriptive to those who are “in the know.”

Imagine you’re working on a temperature regulation system and need functions to identify areas where the temperature has exceeded an upper or lower threshold. You write an enum to represent the state of an area that’s too hot or too cold:

enum ThresholdBreachState
{
  Hoth,
  Mustafar
}

Bad example - These names are cool but require specific knowledge as well as context about the person who wrote them

Now, this is actually pretty awesome, and if I saw this in your code, I’d probably buy you a beer. But realistically, this is too niche a description, and the mental leap required to connect the dots is burdensome.

A more universally understandable version would be:

enum ThresholdBreachState
{
  MaxExceeded,
  MinExceeded
}

Good example - These names are not cool, but they are meaningful and easy for any developer to understand

Let’s say you have two developers on your team who are unusually tall and short, colloquially referred to as Big John and Little Dave. You’re working on code to compress and decompress messages entering and leaving a queue and name the methods BigJohnify and LittleDavify. Although the prefixes may hint at the methods’ functions, this requires a specific knowledge of the team dynamic and could easily lead to confusion.

public byte[] BigJohnify(Stream input)
{
    //
}

public byte[] LittleDavify(Stream input)
{
    //
}

Bad example - You might think this is fun - John and Dave might even think so too - but the meaning here is completely unclear

For instance, if nicknames are used ironically (think of “Little John” from Robin Hood), it’s possible that LittleDavify actually decompresses messages while BigJohnify compresses them. Did you spot the word "respectively" at the end of the first sentence? Anyone “in the know” might understand this, but it demands unique insider knowledge and risks being both unprofessional and confusing.

A far better method name pair would be CompressMessage and DecompressMessage. They are clear and concise to anyone reading the code, without the need for insider knowledge or the cognitive load of applying it.

public byte[] Compress(Stream input)
{
    //
}

public byte[] Decompress(Stream input)
{
    //
}

Good example - These method names are much better as they instantly convey to anyone what they do

We open source.Loving SSW Rules? Star us on GitHub. Star
Stand by... we're migrating this site to TinaCMS