JavaScript I Can Live With

I've never been a fan of JavaScript. Not because of the language itself. Syntactically it's a lot like C# (which I love) and functionally it provides a wealth of features for web programming. My issue has always been with actually writing the code. Due to the fact that JavaScript isn't statically typed it's difficult to create truly good tooling and it's always felt to me like programming JavaScript in notepad is almost as good as with the best IDE. In my book that makes it a very cumbersome language to work with for all but the simplest applications. After working with C# for the last eight years and experiencing the power that a statically typed language and a good IDE provide I find it very painful to go back to a language that doesn't. Maybe I'm just spoiled but going back to a language like JavaScript makes me feel like I've moved back in time a decade. Enter TypeScript.

TypeScript is a new language from the creator of C#, Anders Hejlsberg, and his group. The language exactly addresses my major issue with JavaScript by allowing you to create JavaScript with static type checking through the use of simple argument attributes. Anders describes TypeScript as a "super-set of JavaScript". It really is just a tooling language allowing developers to employ the power of modern IDEs, such as Visual Studio, while writing JavaScript code. You get type safety, class structures and intellisense style self documentation while coding and the output of compile is standard, idiomatic JavaScript. It works with all JavaScript libraries and on all platforms that run JavaScript because it's simply a tooling layer over the top of JavaScript. It only exists as TypeScript while writing the code. A beautiful solution to the problem.