4 ms·
Well, loose typing allows for far faster prototyping. I know some people will debate me on this, but mixing int and string in an array or returning an object or
by Sebb767 6y ago
Well, loose typing allows for far faster prototyping. I know some people will debate me on this, but mixing int and string in an array or returning an object or a string is far faster than going the 'proper' way. It's not great, but it gets you started earlier and that's a big point.
Another thing is that it's extremely easy to migrate from vanilla JavaScript to Typescript. You simply add a compile step at first, which breaks nothing, and then you slowly move your js files to ts while still being able to cross use them. I've migrated a ~10k LOC app and it was a breeze - whenever I needed to touch a module, I simply took the 5 minutes to make it TS. Whenever I touched a function, I added the type parameter. Being able to slowly convert a big app without ever having a major breakage or a massive change is something extremely valuable and rare (looking at you, `async`).
- arkanciscan 6y agoTypeScript just moves all errors from runtime to compiletime, even the ones nobody would ever realistically encounter. The user's browser is the only typechecker that matters, and that's why end-to-end tests are more important than type-linting.