AR
alx richards
all posts
2026.03.02ts8 min read

TypeScript over JavaScript: a quiet manifesto

Not a hot take — just the practical case for defaulting to TypeScript on every new project.

I'm not going to argue that TypeScript is perfect. The config can be annoying, the error messages are sometimes a wall of red text, and yes, as unknown as T exists and we've all used it.

But I default to TypeScript on every new project now, and I'd have a hard time going back.

The real benefit isn't the type errors

When people argue for TypeScript, they usually lead with "it catches bugs at compile time." That's true, but it undersells the actual value.

The bigger benefit is that TypeScript forces you to model your domain. When you write function getUser(id: string): Promise<User | null>, you've made three decisions explicit:

  1. IDs are strings
  2. This is async
  3. The user might not exist

In plain JavaScript, all of that is implicit. It lives in your head or in a comment that gets stale. In TypeScript, it lives in the code, and the compiler enforces it.

It changes how you read code

A typed codebase is easier to navigate because you can follow the types. When I'm reading a function I didn't write, the first thing I do is look at the signature. That tells me what the function expects and what it promises to return. I don't need to trace the entire implementation to understand the contract.

This compounds on larger teams. "What shape does this API return?" becomes a question you answer by looking at a type, not by reading the fetch call, the handler, the service layer, and the database query.

The migration argument

"But we'd have to migrate our existing codebase." Fair. If you have 200k lines of JavaScript, a full TypeScript migration is a real project.

But new code is free. TypeScript is a superset of JavaScript — you can add .ts and .tsx files to an existing JS project with no migration required. The types spread organically from the places you add them.

The one situation where I don't bother

Quick scripts. One-off data transformations. Something I'm writing in a scratch file that I'll delete tomorrow.

For everything else — any project that will exist in three months, that someone else might read, that has a data model worth expressing — TypeScript. Not because I enjoy fighting the type system (sometimes I do), but because the constraints it forces on you are usually the right ones.

Alexander Richards2026.03.02