QUANHEX.
Engineering

Why TypeScript Changed How We Build Software

After years of JavaScript, adopting TypeScript transformed how we reason about code quality, team collaboration, and refactoring confidence.

· 6 min read

We resisted TypeScript for longer than we should have. We were fast in JavaScript, our projects worked, and adding a build step felt like ceremony. Then we joined a team maintaining a 200,000-line codebase and changed our minds within the first week.

The Real Value Isn’t Type Safety

Most TypeScript advocates lead with “fewer runtime errors.” That’s true, but it undersells the real benefit: TypeScript makes your codebase readable to machines, and machines are very good at helping you.

When your editor understands the shape of every object in your system, autocomplete becomes documentation. Refactoring a function signature becomes a compiler-guided task list. Code review shifts from “does this look right” to “the types tell us it’s right.”

Interfaces as Contracts

The pattern that changed our workflow most was treating interfaces as the first artifact of any feature, not the last.

Before we write a single function, we define the data shapes involved. This forces clarity about what a feature actually needs. It catches design problems before they become implementation problems.

interface ContactSubmission {
  name: string;
  email: string;
  message: string;
  submittedAt: Date;
}

Writing this first surfaces questions: Do we need a timestamp? Is message optional? Should email be validated at the type level or at runtime? TypeScript doesn’t answer these — but it forces you to ask them.

Generics Unlock Reuse

Once we understood generics, our utility code became dramatically more reusable without losing any type information.

async function fetchOne<T>(url: string): Promise<T | null> {
  try {
    const res = await fetch(url);
    if (!res.ok) return null;
    return res.json() as Promise<T>;
  } catch {
    return null;
  }
}

One function, infinitely composable, fully typed at every call site.

The Migration Strategy That Works

For existing projects, don’t migrate all at once. Add "allowJs": true to your tsconfig, rename files to .ts one at a time, and start with the shared utilities and data models that the rest of the app depends on. Let the compiler show you the blast radius.

TypeScript’s strict mode is your goal, not your starting point. Get there incrementally.

Where We Land Today

Every project we start is TypeScript from day one. The tooling investment pays back within the first week of development, and the compounding benefits through the life of a project are substantial. If you’re still on the fence, the fence is the problem.