Why I Switched to TypeScript

After years of plain JavaScript, here's why TypeScript has become my default for new projects.

I resisted TypeScript for years. "JavaScript is fine," I'd say. "Types just slow you down." It took a particularly painful debugging session—three hours tracking down a typo in a property name—to finally make me reconsider.

The Turning Point

The bug was simple: user.emial instead of user.email. In TypeScript, this would have been caught instantly. In JavaScript, it silently returned undefined and caused a cascade of confusing errors downstream.

What Actually Changed

The biggest shift wasn't catching typos—it was how I design code. Types force you to think about data shapes upfront. What does this function accept? What does it return? These questions, which I used to answer implicitly (and inconsistently), now have explicit answers.

interface User {
  id: string;
  email: string;
  role: 'admin' | 'user';
  createdAt: Date;
}

function getDisplayName(user: User): string {
  return user.email.split('@')[0];
}

The Productivity Myth

"Types slow you down" is only true if you measure velocity by lines written per hour. If you measure by working features shipped, TypeScript is faster. The time spent writing types is paid back many times over in reduced debugging and easier refactoring.

When I Still Use JavaScript

Quick scripts, prototypes, and small utilities where I'm the only user. But for anything that will be maintained, extended, or used by others—TypeScript is now my default.

Getting Started

If you're hesitant, start with strict: false in your tsconfig and gradually enable stricter checks. You don't have to go all-in immediately. TypeScript meets you where you are.