Hacker News new | past | comments | ask | show | jobs | submit
For someone who writes TS only occasionally and mostly doesn't care about the JS ecosystem, this is a great article. I picked up a few tricks. That said, normalization of warts is a common thing in JS, and people tend to just live with it rather than fix it. This feels like another example of that.

In Go, if something is discouraged (unsafe, runtime, reflection shenanigans), you immediately know why. The language is mostly free of things that exist but you shouldn’t use.

TS was a breath of fresh air when it came out. I never took Node seriously for backend work—it was always something I reluctantly touched for client-side stuff. But TS made some of JS’s warts bearable. Over time, though, it’s added so many crufts and features that these days, I shudder at the thought of reading a TS expert’s type sludge.

TS type sludge is required to make the JS underneath workable.

I'd welcome TS type system in Python, mypy and co. should steal it outright.

I'm a Python developer, and use a bunch of types day-to-day, I haven't used TS aside from intermittent curiousity.

Curious what aspects TS has that Python doesn't? (or that Python doesn't do as well)

I really like that TS makes it possible to work with raw objects (~dicts) without having to worry about keys existing or not existing, especially narrowing down via Pick<> and tricks related to impossible combinations via the never type are nice (e.g. if it has key 'a', it can't have key 'b' and vice versa). That said Python's typing doesn't sit still and I tuned out a couple of years ago, so all those things might be possible today via TypedDict, haven't checked).
loading story #42767541
> I never took Node seriously for backend work—it was always something I reluctantly touched for client-side stuff

That was my initial assessment as well. Anything JavaScript related I stood clear and far away from using it anywhere near backend systems and relegated it into the list of non-serious technologies to stay away from.

> Over time, though, it’s added so many crufts and features that these days, I shudder at the thought of reading a TS expert’s type sludge.

TypeScript just repeated the same issues as CoffeeScript and both JS and TS are just as bad for software anyways.

Go and Kotlin have much better type systems, but the rest of the JS ecosystem just reeks with immaturity.