7 March 2026

Don't Abbreviate

Engineers have a bad habit of abbreviating things. I guess it comes from some deep programming culture set in the 70's or 80's where space was expensive and being brief was better. But these days it just makes code harder to read:

I prefer using fully qualified names for variables, methods, and classes.

Imagine you have an Abbreviation class. It's tempting to instantiate and store it in a number of variable names:

const a = new Abbreviation();
const abbr = new Abbreviation();
const abbreviation = new Abbreviation();

In isolation, all of these could be considered reasonable, and someone could make the case for each one. But it makes code hard to read, and if you're inconsistent, it makes code very hard to read.

function generateAbbr(fulltext: string) {
  const a = new Abbreviation(fulltext);
  // ... do something
  return a;
}

function manipAbbrev(abbrev: Abbreviation) {
  // some manipulation
}

const abbr = generateAbbr('this is my text');
const abbrs = [
  new Abbrevation('...'),
  abbr,
];

abbrs.foreach((abbrev) => {
  manipAbbrev(abbrev);
})

Maybe more verbose, but I much prefer the alternative:

function generateAbbreviation(fulltext: string) {
  const abbreviation = new Abbreviation(fulltext);
  // ... do something
  return abbreviation;
}

function manipulateAbbreviation(abbreviation: Abbreviation) {
  // some manipulation
}

const abbreviation = generateAbbreviation('this is my text');
const abbreviations = [
  new Abbrevation('...'),
  abbreviation,
];

abbreviations.foreach((abbreviation) => {
  manipulateAbbreviation(abbreviation);
})