Typescript is a real pain, I’m still trying to figure out why it’s so popular. The constant nagging and extra typing (no pun intended) when using it vs regular JavaScript makes it a pain. Then, there’s the extra parsing step to change it back to JavaScript. Idk I don’t see the value yet.
Edit: I say “parsing step “ because that’s what it is. There’s no “compiling” and “transpile” is just a ridiculous way of saying parse and output.
Just to add some color to this… values come in from the DOM as strings or numbers or booleans. They go out over HTTP as strings. (These are approximations, I’m going from memory.) The question then becomes: Should I inspect the values or just pass the values along? You can see how a simple form might just collect data and pass it along to a backend, maybe do a bit of cursory inspection of the values to make sure they’re in range. A sophisticated web app, on the other hand, might construct an in-browser-memory model from the data, and so needs to vigorously ensure that the data is correct. In the first case types can be a pain since you’re not telling the compiler anything that isn’t already well understood. In latter case they’re a necessity.
I love types I just struggle with Typescript a lot because it seems to get in the way for me. I might like it more if I buckled down and really tried to figure it out. It’s probably the slowest language for me to grasp maybe outside of Objective C.
When you try to enforce typing on a language that wasn’t designed ground up with types in mind it just rubs me the wrong way. Python type hinting strikes a good balance though.
Edit: I say “parsing step “ because that’s what it is. There’s no “compiling” and “transpile” is just a ridiculous way of saying parse and output.