4 ms·
TypeScript is amazing. Not just from a feature point of view, but also from a tooling and usability point of view. The flexibility of tsconfig.json and the shee
by omeze 8y ago
TypeScript is amazing. Not just from a feature point of view, but also from a tooling and usability point of view. The flexibility of tsconfig.json and the sheer volume of @types packages has allowed my workplace to introduce it to our core JS codebase over the past 2 years, with pretty much 0 hiccups. It's actually annoying hopping into Go and Python and not having such a powerful type system at my disposal.
I'm not sure how the TS project itself is organized, but I wonder if the type system could be adapted to provide static types to other languages, like Python.
As for 3.2, I'm happy to see the narrowing for tagged unions. I ran into a small annoyance with this a few weeks ago. Looking forward to variadic types in a future release!
- akmittal 8y ago> Go and Python and not having such a powerful type system at my disposal. Python may not have that great type support. But I found Go type system to be quite good. Can you elaborate
- omeze 8y agoThe biggest annoyances are the lack of exhaustive pattern matching and the lack of sum types. I say annoyances because its possible to get most of the behavior for sum types with interfaces but a lot more boilerplate must be written. And, while Go offers no exhaustive pattern matches, in practice the use of a default switch that returns an err works OK. But at the end of the day, I find my colleagues a lot less elegant and rigorous with their Go types/structs compared to their Typescript code because of the additional boilerplate, which makes me think language ergonomics around types makes a difference in code quality around data modeling. Its not an monumental chasm, but it exists.