4 ms·
Am I the only one who thinks typed Javascript, wether it's TypeScript or Flow, is a really flakey experience? I really enjoy Swift, so I'm not put off by types
by tomelders 10y ago
Am I the only one who thinks typed Javascript, wether it's TypeScript or Flow, is a really flakey experience?
I really enjoy Swift, so I'm not put off by types. But I find the experience of working in a real typed language to be very different to working with Flow or Typescript, where the types are for pretend, and type definitions are wrong often enough to be a real pain. And I found my self evaluating npm packages based on their type definitions, and not their suitability for the task, which seems bonkers to me.
Also, I don't ever recall staying late to track down a bug that types would have fixed. But I've wasted many an hour tracking down bugs caused by mutations, and the state of Immutability and Typed Javascript is pretty grim as far as I can tell, unless I'm missing something.
- rubiquity 10y agoTypes are pretend in TypeScript and Flow the same way that types are pretend in any other typed language. Types are used at compile-time and not runtime in both cases.
- egeozcan 10y agoIn contrast to many typed languages, currently in Typescript, you can't do any kind of reflection so runtime really has no access to the type system. Well, I still love TS though.
- johnfn 10y agoThere is the possibility of decorators for stuff like this. Angular makes a lot of use of them.
- tomelders 10y agoAre they used at compile time with TS or Flow? I thought they were just stripped out.
- wtetzner 10y agoWell, I assume they're at least used at type-checking time, which most people consider to be a subset of compile time.
- recursive 10y agoIn most other languages, type casts are assertions that can fail. Not typescript.
- johnfn 10y ago> the state of Immutability and Typed Javascript is pretty grim as far as I can tell, unless I'm missing something. You definitely are missing something. Immutablejs and TS go together fine. Assigning to an immutable property or object is a syntax error instead of a runtime error. It's great.
- tomelders 10y agoI'll need to take another look at TypeScript. Last I checked you have to wrap your immutable records in classes with both TS and Flow. That's still true for Flow as far as I know.
- johnfn 10y agoI actually made my own type definitions that made immutablejs records "just work" for TS. I submitted them to the immutablejs guys, but they never acted on them.
- fwefwwfe 10y agoYou're missing Scalajs.