TypeScript seems C# flange-mounted on top of JavaScript, but it's probaby the only viable alternative with good js-interop...
TypeScript seems C# flange-mounted on top of JavaScript, but it's probaby the only viable alternative with good js-interop...
TypeScript is a superscript of javascript. It doesn't have a runtime - it gets transcompiled into javascript. If coffeescript is for writing javascript like you would write python or ruby, then typescript is for writing javascript like you would C#.
I've used TypeScript on a large project I'm working on. Sometimes I regret it. I went with typescript mainly because I was not as confident that I could just jump into building a large JS codebase. Now that I've been in that world for a year, many times I'm wishing that I had just gone with JS from the start, or maybe limited my use of TypeScript to just type annotations.
I have however been annoyed at not being able to use sweet.js macros.
Basically the problem was that we were trying to write TypeScript like we were writing C#, instead of treating typescript like a layer on top of JavaScript.
Yeah, you do have to know JavaScript, since TypeScript only adds a few ES6 features and types.
Since the 0.9.5 release, I don't think I've had any particular issues with typechecking or the language. And as someone mentioned, if you use lambdas, the compiler will automatically handle performing the `var _this = this;` trick for you under-the-hood.
> we were trying to write TypeScript like we were writing C#
Yeah, you really need to approach writing TypeScript as if you are writing idiomatic JavaScript. I'm happy that I went through the JavaScript mill before discovering TypeScript, as it informed how I developed my project.
I was under the impression that was most if not all of typescript. What else remains? Classes?`