Re:TypeScript included with Visual Studio 2013 Update 2
by jvilk on Friday February 28, 2014 @02:01PM
(#7320746)
Earlier versions of TypeScript had some significant typing issues in my experience, especially related to typechecking static fields on object instances (which you can't access through object instances -- you have to go through the class object).
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.
Re:TypeScript included with Visual Studio 2013 Update 2
by lucian1900 on Friday February 28, 2014 @12:40PM
(#7320219)
TypeScript's ES6 lambdas are actually closures over `this` as well, the compiler will insert `var _self = this;` in the enclosing scope if you have a lambda.
Yeah, you do have to know JavaScript, since TypeScript only adds a few ES6 features and types.
Re:TypeScript included with Visual Studio 2013 Update 2
by dpratt71 on Friday February 28, 2014 @07:35PM
(#7322494)
I've been using TypeScript (since v.9) on a project that uses Knockout.js extensively. In short, I really like it. The generics support in TS is quite good, which I think is very important for a framework like KO.
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.