But is it worth your time to learn TypeScript? Can it really improve your dev projects? There are varying opinions on this subject. I’d like to weigh in by clarifying some points regarding TypeScript’s value and how it compares to CoffeeScript & Babel.
There’s a lot to be said about this little superset language. It has skyrocketed to popularity in just a few short years with complete adoption from AngularJS and many dev workflows.
But if you don’t already know TypeScript is it worth learning? My opinion is yes—but only if you’ll be able to apply the features to your daily workflow.
If you’re a hobbyist then TypeScript may not be vital to learn(but could still be fun). If you prefer ES2015 with Babel then TypeScript might not interest you at all.
But if you’re a professional frontend developer or hoping to become one, TypeScript is well worth learning. Even if you only pick up 5% of the language it’s still worth familiarizing yourself with the concepts to make yourself attractive for employment.
AngularJS is also big on TypeScript so it’s a lucrative learning investment for many areas of web development.
And after reading developer feedback I feel that if you can make the time, TypeScript is worth the time.
Microsoft created TypeScript with its first public release in October 2012. Anders Hejlsberg, the creator of Delphi and a lead C# architect, played a major role in the development of TypeScript.
Initially TypeScript required the MS Visual Studio for an IDE which wasn’t great for Mac or Linux users. But other IDEs quickly brought support for TypeScript either internally or through open source.
About two years later TypeScript 1.0 was released at Microsoft’s Build 2014 event.
Around this time some developers from the AngularJS team created AtScript. The idea was to extend TypeScript and use this newer language with the upcoming Angular 2.0 framework.
Within a year AtScript was merged with TypeScript and the initial AtScript project was abandoned.
This led to greater popularity for TypeScript and rapid adoption of AngularJS from the development community.
Here’s another post by TJ VanToll discussing some TypeScript history and the role it currently plays in modern web development.
Babel is a program which compiles ES6/ES2015 code down to ES5(the JS spec that browsers understand).
TypeScript has its own compiler which takes in .ts files and outputs JS code in either ES5 or ES6, your choice. Babel is not a language like TypeScript. Babel is just a compiler which takes in ES6 code and outputs ES5 code.
So Babel is a compiler, TS is a language with a compiler.
If you learn TypeScript it’ll most often outperform Babel for personal work, but TS may not be supported in every dev team. This is where ES6/Babel knowledge is more valuable.
But to repeat the top answer from this Quora post: it’s all a matter of preference.
Crafty developers can use a task runner like Gulp to use both compilers within the same dev environment. Seems a little excessive, but if there’s a will you’ve got a way.
This is one of the most frequently asked questions about modern JS development. Should you learn CoffeeScript, TypeScript, or both?
So let’s answer another question: is CoffeeScript worth learning? At this point in time I have to say no. Unless you have a specific project or job that requires CoffeeScript, your time would be much better spent learning TypeScript.
This post along with these comments make the best arguments against CoffeeScript—again, not because it’s a bad language. But because it adds an extra layer of confusion into the development process and it doesn’t really solve any major problems in the process.
There are so many damn languages and frameworks to learn. New technologies come out so often that the web dev landscape changes every 5 years.
If you’re gonna put your energy into anything, go with ES2015/Babel or go with TypeScript.
A large handful of reasons could be listed for why you might use TypeScript. Let’s consider the immediate benefits TS can offer and how it could fit into a typical workflow.
thiscan be set to operate within the current class or method
TypeScript can be installed through NPM which makes Node an easy choice, especially with Node/TS modules. TypeScript ties into Angular development which has quickly become a fast-growing frontend framework.
So where does ES6 fit into this workflow?
But TypeScript can become part of your ES6 workflow and likely make it better.
You should also consider that ES6 will eventually be supported by all web browsers(or so we hope). At that point Babel may not have as much of a purpose, but TypeScript would still be useful with its type checking and support with Angular 2 development.
The deciding factor is if you personally find it worthwhile to pick up TS and start practicing.
If you’re now bound and determined to learn TypeScript the best place to start is research & self-study. Check out some of these resources and see if any could help you get started.
Articles and online tutorials are often the easiest introductory materials. I recommend this post for beginners trying to understand TypeScript.
Here are some other posts worth reading:
Books are the original learning materials and they still work great. We recently did a roundup of TypeScript books in greater detail, but you can find a few I really like that I’ve covered in brief summaries below.
Most books come in print & digital versions so you should be able to find something that works.
If you’re OK with online books I recommend the free TypeScript Deep Dive with ePub/PDF formats hosted for free on GitHub.
Also consider some of the books coming out of Packt Publishing. They have an incredible list of TypeScript resources for every level of development: TypeScript Essentials and Learning TypeScript are both great for beginners.
Intermediate-to-advanced JS/TypeScript users should look into Mastering TypeScript by Nathan Rozentals. It covers practical examples of TS development including project crossovers with frameworks like Angular and Node.
The Pro TypeScript book is a few years old but still considered a fine resource. Honestly you can’t go wrong with any of these books and I’m sure more TypeScript books are slated for publication in the years to come.
In fact, at the time of this writing TypeScript Design Patterns is one such example. It’s currently available for pre-order and scheduled for release in late summer 2016.
If you want something a little less structured why not search for presentations on YouTube? Conference videos can be fun and surprisingly educational.
Some conferences record various keynotes and presentations which then get uploaded to YouTube for free.
One particular keynote by TypeScript developer Anders Hejlsberg is well worth watching. It’s just over 50 minutes long but video quality is great and it’s one of the first major presentations regarding TypeScript’s future in web development.
Here are a few other conference videos you might enjoy:
But remember that the best way to learn is through practice. You’ll find plenty of resources online that help you learn how to practice, but like most things you’ll need to give real effort to see results.
If you’re already convinced that you want to learn TypeScript then nothing can stand in your way.
We usually only do things when we have a good enough reason or motivation to do so. If you were wishy-washy on the value of TypeScript, I hope this post can at least sway you to see it as a real asset to web development.
Generally speaking, TypeScript is on an upswing and it clearly adds value to the JS dev workflow. If you can find a way to use TypeScript or if you’re a JS dev that just wants to tinker, you’ll find that TypeScript will not disappoint.
But plain ES6 is also a genuine avenue to follow. In the current market I wouldn’t say TS is a requirement; but it is absolutely an asset. And it’s for that reason I say if you have the time to learn, TypeScript really is worth learning.