I’m a big fan of dynamic languages, like Ruby and Elixir, but when I’m using them I know that the interpreter will strongly check types and not allow non-sensical code to continue running.
What is Typescript?
Typescript is ES6 with a few additional, but key, features:
Why should we use it?
Types are documentation
You’re not locked in
You can think about the Typescript compiler as an incredibly powerful linter and it’s not going to add a massive amount of additional configuration to your existing setup.
Interfaces let you remove data clumps
This works better than just wrapping your parameter in a POJO because we can ensure that the object being passed around has the fields you’re looking for at compile time, rather than adding a bunch of error-checking code to guard at runtime.
It makes the tooling better
Giving tools an idea of the types you’re working with allows them to offer much deeper insight and help with your code. For example the Typescript Intellisense service in Visual Studio Code does a much better job at code completion, hinting and type definitions of code you’re calling into.
How do you get started?
Well, if you’re like me, you’ll start by reading the manual. Make sure you know what is Typescript and what is plain old ES6 and you’ll be off to a good start.
You’re welcome to leave me any questions in the comments or contact me for more info: email@example.com