Wednesday, October 1, 2014

10 Reasons to start using Typescript now!

Why Typescript?!

10 Reasons to start using Typescript now!


  1. Typescript is open source. Yes, Microsoft created it, but you can fork the source on github!
  2.  Start using the next version of javascript—>ES6, today in fairly mature 1.1+ version language. The ES6 language adds features such as modules and classes (and in typescript even interfaces). Typescript will track the emerging ES6 standard and add those features as they become solid.
  3. Typescript is a superscript of javascript so you can begin to use it incrementally. The first step can be to change *.js to *.ts and immediately see the benefits of some internal type checking. 
  4. Typescript produces idiomatic javascript without any need for runtime libs. So, if you want to ditch the typescript at any point you can and just use the javascript files it produces. The type checking is done in the compile step so no extra code is added. [Unlike other ES6 transpilers, like Traceur that require a runtime library as well]
  5. Type safety. Typescript has an optional type safety feature so that if you only want type safe signatures on the public apis then you only pay that price on the public API.
  6. Get the benefits of a nice(modern) syntax like Coffeescript, but with type checking and the emerging standard ES6 syntax as well
  7. Typescript works well with all of your existing javascript libraries. Want to do just a few modules in Typescript and have it integrate with your existing codebase — no problem. [This is more difficult to do with Dart]
  8. If you are coming from languages like java or C#, then the familiar design patterns (like GoF) are available instead of having to learn all the javascript design patterns (many of which rely upon closures for modularity). Typescript Design Patterns. Also, the ability to think in terms of normal classes aids in creating classic Object-Oriented Design familiar to java and C# folks.
  9. Its framework agnostic use it with whatever framework you want — "Typescript don’t care its a Honey Badger!"
  10. Use whatever tooling you want. It is just a command-line compiler. Want full ide support, use WebStorm or Visual Studio (they have intelligent support for Typescript). Want something lightweight use Sublime Text (there are Typescript plugins available as well).