Thoughts on TypeScript, Dart, and the future of browser-based coding
I'm still a bit puzzled by all the hate for TypeScript. There seem to be a lot of NaySayers, but I've still yet to see a single example of a codebase that couldn't benefit from TypeScript. Since it's a superset of JS, you don't have to do anything to start using it except rename your .js files to .ts, and then you can add TypeScript only where you think it will add value.
It's like having a magic switch that helps you find errors and refactor. How can it possibly be a bad thing?
There was also some discussion about Dart following on from +Kevin Darty's tweet, like:
@cdhowie what about how MSFT Devs everywhere ripped Google a new one for Dart but are embracing TypeScript with open arms. Hypocritical?— Kevin Darty (@kdarty) October 13, 2012
I think Dart is a very ambitious project. I really hope it catches on and we see support in all browsers. However, I just can't see it happening :O( Dart and TypeScript solve some of the same issues but coming from the exact opposite sides.
In an ideal world, the decision to use something like TypeScript vs Dart should be based on things like:
- Whether a Dart runtime is available to the majority of your users
- Whether you need to interact with a lot of existing JS libraries
- Whether you need to interact with a lot of your own JS (legacy projects)
- Whether you can invest the time required to learn Dart (there's a lot less to learn with TypeScript)
However, I can't help but think that the decision is actually going to be based on one thing only:
- Are you using Visual Studio or an Open Source IDE?
I just can't see TypeScript support ever being as good in non-VS IDEs. Nor can I see Dart support in VS ever being as good as it will elsewhere.
I don't know whether any of the existing technologies are good candidates for this (could we compile C#/Java/etc. into Dart? NaCl?), but I think it would be the best solution for all. People could use the IDE and languages they feel most comfortable/productive with.
Chrome already has NaCl, and will presumably have native Dart support soon. I wouldn't be surprised if IE ended up with native TypeScript support. This is going backwards, not forwards.