Why TypeScript has a chance

Microsoft's typed superset of JavaScript packs a bigger punch than other alternative languages that compile to JavaScript.

Microsoft has decided to bring order to the JavaScript universe. That order takes the form of a typed superset of JavaScript, called TypeScript, which promises to offer JavaScript developers new features, such as proper classes, interfaces, and modules.

TypeScript in Visual Studio.
(Credit: Microsoft)

It's far from a new idea to build a language or framework that improves upon JavaScript.

As the 11th most popular language on GitHub, CoffeeScript is the current leader in the space. With its Ruby and Python influenced syntax and reasonable JavaScript that it outputs, there's a lot to like about CoffeeScript.

But if CoffeeScript isn't your thing, the site has an exhaustive list of other JavaScript alternatives.

With so many existing options, why would Microsoft decide to set foot into this arena?

The answer is that it is a simple case of tooling.

The world doesn't need yet another compile to JavaScript language, or another method to bring types into a loose language like JavaScript. But what it does need is a better way to develop the language.

JavaScript is going places, places it was never intended to go.

Lately, whenever a vendor wants to extend its platform with a new language binding, JavaScript seems to popup as the answer. Need a Windows 8 application? Use JavaScript. Want to create a GNOME extension? Use JavaScript.

While development environments and language maturity usually go hand in hand, JavaScript is the exception that proves the rule. The humble JavaScript developer is often left with a toolbox containing a combination of Firebug, various browser development tools, and editor-of-choice autocompletion/IntelliSense plug ins — and the first two options disappear when you get trendy and take JavaScript beyond the browser.

By adding a dash of type structure to JavaScript, TypeScript opens up more inference for editors and IDEs to latch onto — developers that are addicted to IntelliSense are going to love it.

TypeScript's playground: not bad for a text area in a browser.

The fact that TypeScript is a superset of JavaScript should also work in its favour. Whereas CoffeeScript has a different syntax than JavaScript, TypeScript is not that far removed from JavaScript (yet). For developers that are not Ruby syntax aware and do not have large philosophical problems with the way JavaScript behaves, TypeScript gives the ability to add a touch of sanity, while still retaining JavaScript's flexibility when conditions merit it.

TypeScript is released under an Apache licence on Microsoft's CodePlex, but is not yet fully complete — features such as generics are yet to arrive.

It will be interesting to see what TypeScript eventually becomes. Could it become Microsoft's preferred JavaScript? Or will the developer world give it a try and move on?

With language aficionado Anders Hejlsberg leading the charge, it will surely throw up some good concepts and thought bubbles, regardless of whether the language itself gains traction or not.

To give TypeScript a test run, have a quick hack in the TypeScript playground.


Some would say that it is a long way from software engineering to journalism, others would correctly argue that it is a mere 10 metres according to the floor plan.During his first five years with CBS Interactive, Chris started his journalistic advent...

Editor's Picks