As a stubborn old JavaScript developer I resisted TypeScript for a long time. After playing with it a bit I finally see the light. Still feels a bit strange as it simply feels a bit "lose" compared to something like C or Rust. Anyway, I can see it being helpful in some cases. Anyone got comments on TypeScript? Pro and Contra both welcome. Happy to learn.
2 months ago · 👍 alexlevi
I use jsdoc on vanilla JS to document functions and methods. Enabling full checks in VS code and "use strict" everywhere I can is fair enough to me. · 2 months ago
I think, like many things, there's a sweet spot with TS. For me, the sweet spot is enough TS to remove a whole class of crap you just don't get with plain old JS. Too much TS is trying to create some form of end-to-end type safety, especially with complex/derived/code-gen types (say, from a DB) across system boundaries. As per Pareto, I think the first 20% of TS gets you 80% of the value. The other 20% of the value, in many cases, may not be worth it. YMMV, ofc. · 2 months ago
Contra: transpilation step, Microsoft, worse readability (devs underestimate how much impact that has), type gymnastics. Pro: catches the stupid mistakes, improves data structures. · 2 months ago
I think of TypeScript as a “cleaned up” JavaScript. I think it’s great and I would prefer TS over JS. However, I don’t like the extra effort of transpiling because that requires extra tooling having to be installed and configured. I would start using TS if browsers would natively understood it or automatically transpiled it on my behalf. I want to have a file in a file system and that’s it. So I continue to write plain JS. · 2 months ago