Skip to content

Instantly share code, notes, and snippets.

@mtho11
Last active August 29, 2015 14:06
Show Gist options
  • Save mtho11/9cf186fe6513b8db8718 to your computer and use it in GitHub Desktop.
Save mtho11/9cf186fe6513b8db8718 to your computer and use it in GitHub Desktop.
Why Typescript?
# Why Typescript?
### 10 Reasons to start using Typescript now
1) Typescript is opensource. Yes, Microsoft created it, but you can fork the source on [github](https://github.com/Microsoft/TypeScript)
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. 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 it you want to ditch typescript you can and just start using the javascript files it produces. It does the type checking on the compile step so no extra code is added. [ES6 transpilers like traceur require a runtime lib as well]
5) Type safety. Typescript has an optional typesafety feature so that if you only want typesafe signatures on the public apis then you only pay that price on the public API.
6) Get the benefits of a nice 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 familiar design patterns (like GoF) fit right in instead of having to learn the all the javascript design patterns (many of which rely upon closures for modularity).
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment