TypeScript and the Future of JavaScript

TypeScript and the Future of JavaScript

I’m not bashful about my enthusiasm for JavaScript (can enthusiasm be bashful?).  But as many others have pointed out, JavaScript kinda sucks.  And even though ES6 (the next version of JavaScript) has features to help resolve a lot of the pain, developers can’t really use ES6 on public websites for another three to six years.  Remember, up until very recently, web developers were expected to make websites compatible with Internet Explorer 6 (Hello 2001!). ES6 is the future, and it’s here right now, but we can’t use it yet.  So what can we do as JavaScript developers to make our lives better? There are two answers emerging.  One is to write in ES6 and run it through a compiler that “transforms” it into ES5, the current version of JavaScript.  The other is to write in different language entirely, such as Dart or CoffeeScript (get the pun?), which can be compiled into ES5.  Either way, you can write run-anywhere code, but work in a language with fewer pitfalls. But not so fast!  Remember, learning a language takes time, and mastering it takes even more time.  And writing in a language that writes a language ( Dart-> JavaScript)?  That means you need to know both languages, despite any claims to the contrary. I have a pet peeve with code that writes code.  Unless it’s a commercial product, or a popular open source tool, I avoid it because it’s just too easy to write buggy code, which in turn generates more buggy code.  I write all my bugs by hand, thank you very much. Kidding aside, I recommend getting good at JavaScript before learning a language that writes...