The Next Hot Web Tool Brought to You by … Microsoft?

The next hot web tool is about to explode and quite surprisingly to many of us it was created by Microsoft! TypeScript is best described as a JavaScript ‘dialect’ (credit to Anders Hejlsberg) for coining that terminology.

TypeScript isn’t the first of its kind. before TypeScript came CoffeeScript, Dart, Scala.js, ClojureScript and more than 250 others. Why? Is JavaScript not sufficient itself? Part of the reason I believe is that JavaScript usually isn’t the ‘main language’ of developers, not until recently at least (thanks NodeJS). The common gripes about JavaScript from developers is its lack of classical inheritance, dynamic typing, and non standard implementation across environments. In combination all of these elements cause large JavaScript projects to become nearly impossibly complex.

Why is TypeScript the Answer?

I believe TypeScript is going to rise above the crowd for a few simple reasons.

1) TypeScript is a superset of JavaScript.
This means that unlike the most popular competitors, you do not need to learn a new syntax to use TypeScript. CoffeeScript requires the developer to become familiar with a new syntax which looks completely different from JavaScript.

CoffeeScript

class cool 
    awesomeness: 1
    awesome: "yes"
    notAwesome: "no"
    constructor: () -> 
        this.awesomeness = 1
        console.log('coolness stared')
    incrementAwesomeness: () -> this.awesomeness++

TypeScript

class cool {
  awesomeness: number;
  aawesome: "yes";
  notAwesome: "no";
  constructor() {
    	this.awesomeness = 1;
    console.log('coolness stared');
  }
  incrementAwesomeness() {
      this.awesomeness++;
  }
}

Note that TypeScript looks exactly like JavaScript, in fact it looks exactly like ECMAScript 6. CoffeeScript may save you a few keystrokes, but it requires you to learn a new syntax. This is a no-go for most busy developers who don’t code primarily in JavaScript. This also means that to implement it on a project you could simply rename you JavaScript files to .ts and start using ECMAScript 6 functionality like it already exists!

2) TypeScript is non opinionated
Possibly taking a queue from SASS, TypeScript does not require that you use its advanced features. This means, to get started you can simply ease in using a language and syntax you already know! Some of the beauty of TypeScript is that it does come packed with type checking tools that allow you to express JavaScript with static typing you might be familiar with in languages like Java and C#. Static typing is the key to allowing large projects to be much less error prone.

3) Angular 2 is built with TypeScript
Angular 1 has remained the most widely used JavaScript SPA framework despite growing support for React. Angular 2 promises to bring many of the performance benefits developers are loving about React along with the powerful toolkit that Angular is known for.

Because Angular 2 is poised (in my opinion) to become the next most widely used JavaScript framework, TypeScript is going to suddenly gain a huge user base.

4) Promise of support
The partnership between Google and Microsoft probably took many by surprise but with these two powerhouses behind the technology, developers can rest easy that these open source projects will be maintained for years to come. One of the biggest problems for JavaScript developers today is the insane number of open source tools available. It may be free to learn and use these tools, but we are becoming more acutely aware of the opportunity cost of learning a framework or tool that turns out to be a fad.

Ok Microsoft, you have my attention. I have not totally forgiven you yet for the countless forehead smashing hours I have spent debugging in IE, but this is a fantastic step in the right direction.