DEV Community

Charles Ouellet
Charles Ouellet

Posted on • Originally published at snipcart.com on

Should You Learn TypeScript? (Benefits & Resources)

Should You Learn TypeScript? (Benefits & Resources)

Being a JavaScript developer is a commitment to always be on the alert.

The learning curve never stops at a precise moment. So you’re always juggling numerous questions in your head.

“Should I learn Vue.js, React... both?”

“What about functional programming? Looks interesting!”

“Is server-side JavaScript any good?“

"Should I learn TypeScript?"

Today I feel like tackling this last question.

We recently played with TypeScript at Snipcart: we're using it to re-write our cart's next version. So, perfect timing to dive into TS on the blog!

This post will cover:

  1. What is TypeScript?
  2. Why should you learn it?
  3. When should you use it?
  4. How can you start learning TypeScript?

I’ve also prepared code examples to demonstrate differences between TypeScript and JavaScript.

Let’s get started!

What is TypeScript?

TypeScript is a statically typed superset of JavaScript that compiles to plain JavaScript.

In other words, it's JavaScript that scales.

learn-typescript

But to truly understand what it means, we first have to backpedal into the evolution of JavaScript. Actually, we have to remember what JS was intended for.

JS started as the language of the browsers, at a time where they were not that powerful. Being a dynamic language—with no “type” system—its aim wasn’t to build large-scale apps.

In the last five to six years though, JavaScript has exploded. It’s used everywhere: from 100-1000000 code lines programs. The problem is, it doesn’t have the scaling abilities of more mature language like C# or Java.

Some eventually asked: What can we do to make JavaScript scale better?

TypeScript was Anders Hejlsberg and Microsoft's answer.

→ Read the full post here

Top comments (0)