TypeScript is a strongly typed superset of JavaScript, which means it adds some syntactical benefits to the language and then compiles it into JavaScript.

One of the key benefits of TypeScript includes debugging at compile time instead of runtime.

It encourages a more declarative style of programming and by defining types it is easier to spot when something goes wrong and get immediate feedback about it.

This is coping with the number one issue JavaScript is bad at which is ensuring that proper types is passed without tests.

So when would you want to use TypeScript in your projects?

When applications grow in size and the code base is getting bigger and bigger it has long been a common problem that things tend to get messy and end up becoming “spaghetti code”.

Design patterns like the “module pattern” where introduced to JavaScript to deal with this. By grouping and structuring the code and making that whole mess into some nice “ravioli” instead… mm yummy.

This worked out pretty well and still does and these design patterns are widely used to building enterprise applications today.

What TypeScript does is bringing extra flavour to the mix to get more maintainable code by “cleaning up” the application.

TypeScript is commonly used together with Angular 2 and that is how it really started to grow in popularity. The beauty of this is that it can be used with any framework or library such as i.e. React.

In fact when I first started out using TypeScript I did so in Angular 2 and omitted it in React. Today I prefer to use it in most react apps that I create.

Can TypeScript make me a better JavaScript-programmer?

Now another benefit that TypeScript brings, which is a personal opinion of mine (and may be widely opinionated) – is that I believe that it can actually make it easier for new developers to learn JavaScript.

It forces you to think a step further and really care about what and how you declare things like variables and functions etc.

Now of course I do suggest that if you are starting out as a programmer you should really take your time to understand the core basics of the JavaScript language and play around with it.

It is really up to you to make a decision when you feel it’s time to add an extra layer to your coding. As for most things in this world, it should come naturally to you.

If you consider yourself someone of this audience, feel free to comment on the thread below, I’d love to hear your story!