I used typescript for several small hobby projects, and I am convinced that this is the perfect Javascript replacement. My favorite features were:
Declaration files. With declaration files, you can add type information to your javascript libraries. This structured information will provide you with fantastic Intellisense support in VisualStudio.
"Standard" OOP. If you work against C # or Java, you probably won't even need a typescript tutorial. It just works. You have classes, interfaces, access modifiers, extension mechanisms, ...
Built-in module support. typescript has a slightly confusing modular system. You can split your code into several .ts files and just add them, but you can also create different modules.
And finally: Syntax. Sometimes these are the little things that have the greatest impact. The typescript syntax seems just perfect to me. Let me give you some examples:
Enter annotations labeled ":" and enter
var a = 5;
Arrays that work like lists, stacks, ...
var array= [];
And functions with arrow syntax like lambdas:
var array=[]; array.push(1); //... array.forEach((num)->{alert(num);}); //for single statement functions you can write array.forEach((num)->alert(num));
Arrays and lambdas are now typed together:
var array: number[]=[]; array.push(1);
I really enjoyed using typescript. This will greatly increase your productivity. And more to come: http://typescript.codeplex.com/wikipage?title=Roadmap
In release 0.9, shared files will be introduced, and for versions 1.x they plan to implement async / wait calls.
lhk
source share