2 ms·
I'm not an expert in either, but the difference doesn't seem dramatic to me. You can put type annotations in JS also and just use typescript in a way that's si
by tyingq 5y ago
I'm not an expert in either, but the difference doesn't seem dramatic to me. You can put type annotations in JS also and just use typescript in a way that's similar to MyPy. Adding types to either JS or Python seems "not free" to me. You pull in extra tools and syntax for either.
- zbentley 5y agoIn TypeScript, there's no* way to run your code without invoking the type checker, as it has to transpile TS to JS. While you can suppress/reduce the strictness of the checker, you can't avoid it entirely, and opting out takes work. Python is the opposite; using type annotations for any sort of verification is opt-in exclusively, and not part of the language/runtime itself. *Yes, there are some direct TS runtimes/compilers, but they aren't how the vast majority of TS code runs.