Skip to content
Blog

The Argument Against

TypeScript slows down initial development. You have to write more code, define types, and deal with compiler errors that sometimes feel unnecessary. In pure JavaScript, things simply work.

Development3 min read
AlejandroChief Technology Officer

The Argument Against

TypeScript slows down initial development. You have to write more code, define types, and deal with compiler errors that sometimes feel unnecessary. In pure JavaScript, things simply work.

This argument has merit, especially for rapid prototypes or small scripts. The question is whether the upfront cost is offset by later benefits.

What TypeScript Actually Does

TypeScript does not make your code run faster. The browser executes JavaScript, not TypeScript. What it does is move errors from runtime to compile time.

An error you would discover in JavaScript when a user clicks a button and something breaks, you catch in TypeScript while writing the code. Before you save the file, before anything runs.

Documentation That Does Not Lie

Comments can lie. Code changes and comments become outdated. Types cannot lie because the compiler verifies them.

When a function declares that it receives an object with certain properties, that contract is either fulfilled or the code does not compile. There is no ambiguity and no surprises.

This is especially valuable in teams, where someone might change a function without knowing who else uses it. Types make dependencies explicit.

The Effect on Refactoring

Refactoring JavaScript code is scary. You rename a function and hope you have not broken anything. You run the application, test manually, and cross your fingers.

In TypeScript, you rename the function and the compiler shows you exactly every place it is used. You immediately know what else needs to change. Confidence in refactoring increases dramatically.

When Not to Use TypeScript

For small, throwaway scripts, the overhead does not make sense.

For prototypes meant to explore ideas without commitment to the final implementation, JavaScript’s flexibility may be preferable.

When the team does not know TypeScript and there is no time to learn it, forcing adoption creates frustration without benefits.

When to Use TypeScript

Any project expected to be maintained for more than a few months.

Projects with more than one person working on the code.

Code that others will consume as a library or API.

Applications where errors carry significant consequences.

It Is Worth It

TypeScript is not perfect. At times the type system feels like an obstacle, especially with dynamic JavaScript patterns.

But for serious projects with a long lifespan, the initial investment pays for itself many times over through avoided errors, safer refactoring, and more understandable code.

The cost exists. It is worth paying.

Keep reading

Related articles

Development

The Code Slowing Down Your Website Isn't the One You Wrote

Third-party scripts are, on most of the websites we audit, the biggest source of slowness. Not the framework, not the images, not the server: the code you load from other domains. Analytics, support chat, advertising ...

Development

The Language That Machines Actually Understand

Structured data is the most direct way to explain to a machine what your page contains. A human reads “Different Growth, web development agency, rated 4.9 out of 5” and understands it instantly. A search engine, howev...

Next step

Do you have a project in mind?

If this article was useful and you want to know how we can help, we are here to listen.