News for hackers. Stuff that matters.
Re:From Rust to TypeScript by cle on Sunday September 13, 2020 @09:55PM (#24465957)
Ah got it. Tuples come with their own challenges and are quite similar to structs, so I’m not surprised they didn’t make the cut. I’ve had to define structs like you say occasionally, but it literally takes like 2 seconds so I don’t really care, and appreciate not having to decide when to use tuples vs structs and argue with teammates about it too.
Re:From Rust to TypeScript by JamesSwift on Monday September 14, 2020 @09:53AM (#24470132)
Youre right, it definitely isnt a large amount of work. Its the annoyance of the work and the leaky abstraction of "multiple returns" that _look_ (and sort of act) like its a tuple. In addition to channels, it also comes up if you want to store an array of return values.