3 ms·
Personally I have two issues with TS as it exists today. On the one hand I’m reticent to add a transpiler/compiler step between code and the runtime unless ther
by goliatone 6y ago
Personally I have two issues with TS as it exists today. On the one hand I’m reticent to add a transpiler/compiler step between code and the runtime unless there is a very very compelling argument. On the other my perception of TS is that is a tool that removes friction between the language (JS) and tooling without really addressing anything core to the language itself.
Everything people sum up as pros of using TS generally end up in a bucket in my head labeled “compiler work to remove friction”.
I actually use that friction to improve my codebase, in the instances that some sort of type error happens usually is bringing to the surface an related problem/business domain assumption on my part that I need to address upstream to a conceptual or logical off code layer. Some of what TS offers I get around by being very attentive to providing good jsdoc annotations which requieres disciplina and work- so I see the value brings there but the price I pay for that convenience is to high.
Usually what I do is that once a project has reached a point of maturity and the requirements merit it I move parts of it to a typed language (go). That’s for things that need to be both performant and maintenable long term without much effort.
I actually benefit from that rewrite in that I have yet another chance to review assumptions and address higher order
- yawaramin 6y ago> my perception of TS is that is a tool that removes friction between the language (JS) and tooling without really addressing anything core to the language itself. I don't understand what that means. How is TypeScript removing friction between JavaScript and tooling? That doesn't make any sense. TypeScript is a typechecker and a language that compiles to JavaScript.
- klodolph 6y agoI’d say that TypeScript removes friction in the sense that you can use autocomplete fairly easily with it, out of the box. Using autocomplete without type annotations is pretty hard.
- thayne 6y agoAlso, things like automated/safe refactoring, jump to definition, find all usages, etc.
- yawaramin 6y agoOK but then that's ... not actually a criticism? And when the person I replied to says, 'doesn't address issues of the language itself', that's not actually even accurate. TypeScript addresses several large sources of errors in every codebase, like null or undefined errors.