News for hackers. Stuff that matters.
Re:All I Want for Christmas Is These Seven TypeScript Improv... by chadlavi on Sunday December 25, 2022 @10:04PM (#34134112)
These are all really weird and not idiomatic. Most of your weird quibbles would be solved by just writing a type like

const pt: [number, number] = [1, 2]

As for piping functions... that's just how functions work. Not sure what the point of that piping syntactic sugar is.

Re:All I Want for Christmas Is These Seven TypeScript Improv... by antonyt on Sunday December 25, 2022 @10:28PM (#34134253)
It doesn’t have to be the only way that functions work. Pipeline operators are idiomatic in other languages, and the linked proposal in that section of the article is worth reading.
Re:All I Want for Christmas Is These Seven TypeScript Improv... by chadlavi on Sunday December 25, 2022 @11:17PM (#34134529)
Sure, but not in JavaScript.
Re:All I Want for Christmas Is These Seven TypeScript Improv... by jonwest on Sunday December 25, 2022 @11:24PM (#34134571)
I’m admittedly not primarily a TS dev, but I agree with your points completely. Even though you’re reading the piped functions right to left, and most code is going to be read from left to right, in order for a parameter to be passed like a value it’s gotta be computed.

If I’m solving a math equation, I know that I need to follow the order of operations—I don’t need to rewrite the equation in an entirely new way. It’s more intuitive for me, at least, to wrap my head around the current approach.

Re:All I Want for Christmas Is These Seven TypeScript Improv... by bigDinosaur on Monday December 26, 2022 @03:44AM (#34135891)
It takes about thirty seconds to become used to writing nested function calls as a pipe - it's purely syntactic sugar. It's not what I'd call an 'entirely new way' in the sense that changes nothing about evaluation order or anything like that.
Re:All I Want for Christmas Is These Seven TypeScript Improv... by gforge on Monday December 26, 2022 @03:22AM (#34135776)
The pipe is one of those things that once you've tried it you never want to go back.

The pipe came to R a few years back and I would argue that it is one of the best features. I admit that data munging is a very stepwise process but I find myself frequently missing it in Ts when I code. It makes the code denser as you use fewer intermediate variables while the code id still easy to debug.