profile

The Weekly Gist

Writing Code for Readability


Helping you learn practical, straightforward methods to boost your soft skills and enhance your career as a software engineer.


Weekly Newsletter

September 16th, 2025

Writing Code for Readability

Every engineer has opened a file, scrolled through a few lines, and thought: "What does this even do?"

I've been there too — only to realize I was the one who wrote it years ago. What seemed clear in the moment turned into a puzzle later, slowing me down just as much as it would anyone else on the team.

Turns out I'm not alone. Atlassian's 2025 developer survey found that 81% of engineers rank readability as the most important factor in maintainability — more than performance or tool choice.

This week, we'll look at why readability makes teams faster, how to adopt the right mindset, and a few practical skills you can put into practice today.

Readable Code Makes Teams More Effective

Readable code shows its value quickly. A new developer can become productive faster when the code is self-explanatory. Reviews go smoother because teammates can focus on tradeoffs instead of guessing at intent. And when something breaks months later, straightforward code makes it easier to diagnose and safer to fix.

The opposite is just as real. I've seen teams lose half a sprint untangling a function that mixed validation, calculations, and API calls into hundreds of lines. Each small misunderstanding multiplies the cost of every change. At scale, those costs become enormous — Southwest Airlines' 2022 outage was traced back to hard-to-maintain systems and cost the company an estimated $1 billion.

Focusing on readability also pays off in ways that are harder to measure. Clear codebases lower frustration and make it easier to trust each other's work. That trust is what makes collaboration effective — teammates know they can review code quickly, rely on it in production, and extend it without fear of breaking hidden assumptions. Over time, that culture of readability becomes a multiplier for everything the team delivers.

For more on how your work can either create lift or drag for teammates, see Are You Creating Lift or Drag?

Adopting the Right Mindset

Readable code starts with changing how you approach the work. Instead of asking "How can I make this work?", ask "How can I make this clear?" That small shift influences every choice you make as you write.

  • Start with intent. Before you write, think about what problem you're solving and how that intent should show up in the code. For example, naming a variable retryCount tells the reader what it's tracking. Naming it r forces them to guess.
  • Write for the reader. Imagine a teammate opening your file mid-sprint to fix a bug. If they can follow the flow without asking questions, you've succeeded.
  • Default to clarity over shortcuts. A condensed one-liner might feel satisfying, but it usually hides intent. Writing a loop or breaking a step into two lines is rarely slower — but it's almost always easier to understand.
  • Explain the exceptions. Sometimes performance or complexity requires a less obvious solution. That's where comments matter.

These small habits compound. As I wrote in How to Win in the Margins, consistency in the details creates an outsized impact. Choosing clarity every time you sit down to write isn't flashy, but it's one of the fastest ways to earn trust and influence on a team.

Wondering If a Startup Is Right for You?

Big Creek Growth Company shares what it’s really like to work in a startup and what founders are looking for when hiring.

Techniques for Writing Readable Code

Mindset matters, but it only pays off when you apply it in the details. Here are a few practices that make your code easier to read and maintain:

1. Use descriptive names.

A name should make the purpose obvious.

// Unclear
const d = response.data;
// Clear
const userProfile = response.data;

You don't need long names — just enough clarity that the reader doesn't have to check the docs or dig through the code to understand what's being stored.

2. Keep functions focused.

Functions that involve too many steps are harder to follow and test. Splitting them into smaller steps makes the intent clear.

// Hard to follow
async function updateUserProfile(userId, payload, { db, cache, bus }) {
  if (!userId) throw new Error('missing userId');
  if (payload.email && !/^[^@\s]+@[^@\s]+\.[^@\s]+$/.test(payload.email)) {
    throw new Error('bad email');
  }
  payload.phone = String(payload.phone).replace(/\D/g, '');
  if (payload.phone.length === 10) payload.phone = `+1${payload.phone}`;
  const user = await db.users.findById(userId);
  if (!user) throw new Error('not found');
  const profile = { ...user.profile, ...payload, updatedAt: new Date() };
  const saved = await db.users.update(userId, { profile });
  await cache.del(`user:${userId}`);
  await bus.publish('user.profile.updated', { userId });
  return saved.profile;
}
// Easier to follow
async function updateUserProfile(userId, payload, services) {
  validateInput(userId, payload);
  const user = await loadUser(services.db, userId);
  const profile = prepareProfile(user.profile, payload);
  const saved = await saveProfile(services.db, userId, profile);
  await notifyChange(services, userId, Object.keys(payload));
  return saved.profile;
}

The first version attempts to perform validation, normalization, persistence, and handling of side effects all within a single block. The second version still does the same work, but the top-level function now reads like a checklist: validate → load → prepare → save → notify.

3. Flatten your logic.

Deep nesting makes code harder to scan. Guard clauses keep the main path visible.

// Nested
if (user) {
  if (user.isActive) {
    if (!user.isExpired) {
      activateUser(user);
    }
  }
}
// Guard clauses
if (!user) return;
if (!user.isActive) return;
if (user.isExpired) return;
activateUser(user);

4. Comment with purpose.

Comments should explain why, not repeat what.

// Using cached token to avoid unnecessary API calls during page refresh
const token = getCachedToken();

A short explanation of intent or tradeoff is often all that's needed.

5. Be consistent.

A codebase where every file follows the same conventions saves mental effort. Style guides and formatters (like ESLint or Prettier) make this automatic and reduce debate about style.

6. Refactor often.

You won't get it perfect the first time. Code evolves, and clarity fades. Taking a few minutes to rename a variable or split apart a growing function prevents bigger problems later. Refactoring isn't extra work — it's part of finishing the job.

For more on why "done" includes maintainability, not just working code, see When Is Your Work Actually Complete?

Build a Team Culture Around Readability

It's easier to value readability when the team reinforces it together. Reviews, habits, and recognition all send the signal that clarity matters.

Make readability part of code reviews.

Don't just check if the code works — ask if it's clear. A teammate should be able to explain what a function does after reading it once. If they can't, it needs refinement.

Model good habits.

When you split a function into smaller pieces or rename a variable for clarity, call it out. These small demonstrations teach junior developers how to make similar improvements in their own code.

Celebrate clean code.

Highlight examples of clear, well-structured solutions in team chats or retros. Recognizing these moments reinforces that readability matters as much as hitting deadlines.

Connect it to business outcomes.

Unreadable code isn't just annoying — it's expensive. We've seen what unclear systems can cost, like Southwest's 2022 outage. By contrast, teams that make readability a habit avoid rework and reduce long-term risk. For more on how to frame this kind of work, see Tech Debt Prioritization.

Building a culture around readability makes collaboration easier, lowers the cost of change, and creates trust across the team.


Readable code is one of the simplest ways to improve how your team works. It shortens onboarding, makes reviews more valuable, and reduces the cost of every change. More importantly, it builds trust — teammates know they can understand and rely on what you've written.

Performance tradeoffs will come up, but those are rare. In almost every case, clarity is the better long-term investment.

Think of readability as a way of showing respect for your teammates. Every clear variable name, small function, and straightforward code path makes their job easier today and yours easier tomorrow.

I'd love to hear what practices make your code more readable. Reply and let me know — I read every message.


David Ziemann

Founder of MoreThanCoders.com
david@morethancoders.com

Related Articles

5 Tips to Improve Your Communication

3 Easy Critical Thinking Exercises


Follow MoreThanCoders

Was this forwarded to you? Sign up here.


113 Cherry St #92768, Seattle, WA 98104-2205

You're receiving this email because you signed up for the MoreThanCoders Newsletter. If you prefer to not receive these messages anymore, feel free to unsubscribe or update your preferences.

The Weekly Gist

Learn practical, straightforward methods to boost your soft skills and enhance your career as a software engineer because you are so much more than a developer.

Share this page