Simple Patterns, Confusing Names

Let’s be honest: tech jargon can be a nightmare.

Not long ago, I came across the term “early exit pattern.” It sounded fancy, so I read about it, nodded, and moved on. Then it dawned on me: I’d been using this pattern for years without knowing it had a name.

The early exit pattern is just a way to check for problems or special cases at the start of a function and leave early, instead of wrapping everything in a big if block. Like this:

function processUser(user) {
  if (!user) {
    return; // Exit early if user is missing
  }

  // Continue with normal processing
  console.log(`Processing user: ${user.name}`);
}

If someone had asked me in an interview, “Do you use the early exit pattern?” I’d probably blink twice, mumble something about return statements, and hope the conversation moved on.

This happens a lot. People do good work but feel unsure because they don’t know the official name for what they do. It’s like showing up to a club where everyone knows the secret handshake, but you don’t even know there’s a handshake.

Another common confusion is around words like model, entity, and domain object. These terms get tossed around like hot potatoes. For a non-native English speaker, it’s even harder to keep track. What one person calls a “model” might just be a plain data object to someone else.

Let’s look at another example: memoization. It sounds complicated, but it’s really just remembering the result of a function call so you don’t do the same work twice.

Here’s how it looks in JavaScript:

function memoize(fn) {
  const cache = new Map();
  return function (arg) {
    if (cache.has(arg)) {
      return cache.get(arg);
    }
    const result = fn(arg);
    cache.set(arg, result);
    return result;
  };
}

const slowSquare = (n) => {
  console.log('Calculating...');
  return n * n;
};

const fastSquare = memoize(slowSquare);

console.log(fastSquare(5)); // Calculating... 25
console.log(fastSquare(5)); // 25 (cached result, no calculation)

See? Memoization is just caching. Simple.

Or take dependency injection. Sounds fancy, but really it’s just passing things your code needs instead of hardcoding them. This makes your code easier to test and change later.

Example:

class Logger {
  log(message) {
    console.log(`Log: ${message}`);
  }
}

class UserService {
  constructor(logger) {
    this.logger = logger;
  }
  
  createUser(name) {
    this.logger.log(`Creating user: ${name}`);
    // Logic to create user
  }
}

const logger = new Logger();
const userService = new UserService(logger);
userService.createUser('Alice');

No magic here, just passing in what you need.

The funny part? Many of us have been doing these things long before learning their fancy names. But when the jargon hits, it can feel like we’re suddenly lost in translation.

If you’re a non-native English speaker, this struggle is even bigger. Learning programming and the specialized language that comes with it is exhausting. It sometimes feels like you need a translator just to understand a tutorial.

So here’s a little advice: don’t get hung up on the names. If you understand the concept, you’re already ahead of the game. The words are just labels to help us talk to each other, not tests of your skill.

Next time you hear about early exit, memoization, or dependency injection, smile to yourself. Chances are, you’ve already been doing them without even knowing the names.

And if you get confused, just remember: behind every complicated-sounding term is usually a simple idea waiting to be discovered.

← Back to Blog Index   ← Back to Home