3 ms·
I'm on the fence about this one. On the one hand I would love strong typing in JS. But the reason I never adopted TS is because one time I spent months convert
by danielvaughn 5y ago
I'm on the fence about this one. On the one hand I would love strong typing in JS.
But the reason I never adopted TS is because one time I spent months converting Coffeescript back into JS once it fell out of favor. This was back when a bunch of Ruby developers decided that JS should look like Ruby.
If I'm writing Javascript, I'm writing Javascript, not something that pretends to be something else.
- Bilal_io 5y agoThe good news is that you can take your time with it, only start using typescript in new files while converting older ones slowly. And even if you never do that, typescript tooling provides hints and autocompletion to vanilla J's files as well.
- vosper 5y agoYou can convert TS to JS at the drop of a hat. This is part of what’s required to get it to run a browser, which doesn’t understand native TS. It’s different to Coffeescript which was different syntax for JS. TS is additional, type-specific syntax but you are still writing JS. I ran a team that had to maintain a large Coffee codebase, that we could never get the resources to move off. So I know that pain. TS is different, both in how it works and the level of adoption. Coffeescript was always niche, and some benefits were there but they weren’t game-changing for (eg) writing correct code or maintaining large codebases.
- recursive 5y agoYou can generally migrate out of TS very easily if it was the wrong choice. You can mostly use the compiler output as a drop-in replacement for your source code. Depending on compiler options, it's quite readable.
- neurotrace 5y agoOne of the benefits of TypeScript is that it literally is just JavaScript plus some. You can literally run `tsc` and it will spit out JavaScript written the same way as you wrote it but without any of the types. The only things that might look out of place is things like enums or decorators but you can choose not to use them.