TypeScript: How and Why You Should Learn It
What is it?
The main benefits of this are that it allows you to check your code for errors as you go, as opposed to waiting until runtime for the code to compile. This can help eliminate errors on the fly, rather than seeing the problem outputted and having to go back and debug.
But don’t take my word for it. See the full 50 minute video of Hejlsberg introducing the world to TypeScript directly. It is extremely informative and Hejlsberg gives a thorough yet lucid explanation.
Anders Hejlsberg: Introducing TypeScript
Why Should You Use it?
The inverse is also true, if your project is small and simple. The added benefits TypeScript brings are no longer so valid and instead the slightly longer time it takes to add up and run all the types in TypeScript can actually make your project run a little less efficiently.
So if you are working on a large-scale application, the chances are you should use TS>JS. This is especially true because if you already feel comfortable and confident with JS, TypeScript is very easy to learn and doesn’t require wholesale changes. Below are some excellent resources to learn TypeScript so you can use it yourself.
How To Learn It
After watching the video above of Anders Hjelberg introducing TypeScript the best thing to do is read through the official docs. In particular, the ‘TypeScript in 5 minutes’ section and the tutorials.
Another good resource for the theory is the tutorial from TutorialsPoint. It is very word-heavy and lacking fancy graphics but it is informative and clear. These should give you a good base for the theory and how things operate.
For practice writing:
There is an excellent Scrimba by Dylan Israel which goes through how to start building apps.
TypeScript Tutorial: An Intro To TypeScript | Scrimba
This course contains 23 interactive screencasts Introduction to TypeScript Before taking this course, you should have a…
As well as the free Codecademy course on TypeScript which is less accessible than the Scrimba but still very useful.
Learn TypeScript | Codecademy
With these resources you should have a good understanding of how TypeScript works, why it would work for you and how to make it work for your apps.