You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard.
Sure, discipline can prevent some errors. But it’s always possible to run into wrong type assumptions, and I’d say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it’s so useful.
Static type analysis is always a good idea if you’re writing more than a couple lines. IMO Python is the worst offender with its kwargs etc. - discoverability and testability is just so bad if you’re following common Python idioms.
Why? Why not improve JS (e.g. with Temporal), especially given how excellent Typescript is?
I wouldn’t call typescript excellent, if I did it would be on a very low standard.
It unquestionably is excellent. Can you name another language in common use with a type system that’s close to the expressiveness of Typescript?
JS is a lost cause.
How? It’s easy not to run into the common issues by using TS. What’s so bad about it that we should throw away the existing ecosystem?
Please give arguments instead of platitudes.
You don’t need to use TS to avoid common issues. If you add an empty object to an empty array and expect a meaningful result, the problem sits in front of the keyboard.
Sure, discipline can prevent some errors. But it’s always possible to run into wrong type assumptions, and I’d say type coercion and null/undefined access make up a fairly large percentage of non-logic errors. You can entirely prevent those using Typescript, which is why it’s so useful.
Static type analysis is always a good idea if you’re writing more than a couple lines. IMO Python is the worst offender with its
kwargs
etc. - discoverability and testability is just so bad if you’re following common Python idioms.