4 ms·
TypeScript?
by an0nymousse 12y ago
TypeScript?
- eropple 12y agoOver time I've become convinced that the two really viable options are dynamic typing or really good static typing; TypeScript occupies a middling and very rudimentary spot compared to F# (or Scala, which I have more personal experience with; ScalaJS is interesting but I have some pretty huge reservations about that).
- skrebbel 12y agoTypeScript's types are way less powerful and expressive than F#'s. The comparison really doesn't fly. It's even less powerful than C#'s, and it doesn't even come close to adequately supporting a whole range of JavaScript patterns (such as generating "classes" - constructor functions - at runtime). My experience has become that TypeScript is really only suitable for classic OO domain programming, with many nice little classes and mutable state. I work on a project where our model layer (MVC) is made like that, and it works like a charm. Interfacing with other libraries tends to work ok, but you'll have to forget about using --noImplicitAny (and hand in a whole bunch of safety guarantees with that). Doing non-classical-OO stuff quickly becomes a pain. I recently spent many days making a nice Om-style immutable model layer with TypeScript and Immutable.js, and it just doesn't work. The generics simply aren't powerful enough, and I spent days (and many worthless lines of code) fighting it. This saddens me.
- deleted 12y ago[deleted]