5 ms·
TypeScript makes JavaScript a boring, "enterprisey" language. That's a really successful strategy, as seen in Java and C#.
by haolez 6y ago
TypeScript makes JavaScript a boring, "enterprisey" language. That's a really successful strategy, as seen in Java and C#.
- Garlef 6y agoGet deeper into the type system and avoid classes. There's still some fun to be had. But yes: TS can not fully capture what JS is capable of.
- oakesm9 6y agoTypescript is a superset of JavaScript. Valid JavaScript is also valid Typescript. Therefore anything that you can do in JavaScript is also possible in Typescript. You might annoy the type checker, but if you're certain that you know better then there's always ways to disable those errors.
- haolez 6y agoOf course, but that's not why you'd choose TypeScript in the first place.
- afavour 6y agoTo be pedantic: strict TypeScript cannot fully capture what JS is capable of. And, I'd argue, non-strict TypeScript kind of ruins the reason to use TS in the first place.
- domano 6y agoIDE support with JS is sometimes so advanced, that just changing the filename to TS makes the support worse, without any code change. This only goes for some special cases and sadly react-redux with rematch is one of them. Typescript can not understand which types are present in my dispatch object, whereas it is possible with JS autocompletion! Just wanted to bring up this rather curious exception to the rule.
- dragonwriter 6y ago> IDE support with JS is sometimes so advanced, that just changing the filename to TS makes the support worse, without any code change. That’s kind of dumb on the part of the IDE involved.
- Tade0 6y ago> Valid JavaScript is also valid Typescript. Unfortunately, no: https://github.com/microsoft/TypeScript/issues/1863 https://github.com/microsoft/TypeScript/issues/1863
- alpaca128 6y agoI would say it makes JS bearable to use. I don't enjoy wondering whether a bug came from me forgetting to check against null instead of undefined, or accidentally overwriting an object with a string and so on. At least 50% of runtime issues I had earlier are now type errors at compilation and fixed quickly. I'll take boring any day, JS is not a language I want to spend more time with than necessary. I just wish the compilation was faster.
- mejutoco 6y agoI can only assume this is as opposed to Javascript being as dynamic as possible. It is not my kind of fun. I thought maybe Raku (in case you did not know it before) is a language you might also enjoy. It is very expressive and has interesting concepts.