Developer Blog

A blog about development

03:36 PM

TypeScript is here and I'm all for it

Microsoft has published the beta of:

And I'm all for it.

As far as I can see it has 3 things going to for it.

1. It's not Coffeescript.  Don't get me wrong, Coffeescript is nice.  It's just If you know it you now know coffeescript and nothing more.  TypeScript is a SuperSet of Javascript meaning it supports just writing js inline.  As far as I know Coffeescript didn't.

2.  It's got classes, interfaces and type-safety etc.  A conversation I had with a friend went like this, "doesn't the js community hate objects?", The answer is mixed however as much as I like functional programming you have to realize at some point you want to encapsulate state, however immutable.  You do this in javascript now by wrapping it in a closure which is not type safe(the way js currently does it).  So you want safety eh? You do one of two things, you add a class system in the traditional sense or you add a tuple system (ala erlang).  If you add class's you have to have an inheritence system.  If you add tuples you have to have immutable types and pattern matching(the one thing I wished c# had).  TypeScript it seems, has added classes because pattern matching is harder to compile to and teach I imagine.

3.  It's Microsoft backed, VisualStudio support! Syntax highlighting. VisualStudio Compilation.  And it seems like microsoft is publishing the exe free to use on any node platform.

Am I going to just use TypeScript on my next project, NO.  It depends on if i would benefit by having a type system.  But am I going to think about using it for every VisualStudio web project that comes along. Yes.  Because of this superset you can just add it when you feel like.

Check out TypeScript.

(any innacuracies? leave a comment below)