News for hackers. Stuff that matters.
Re:Highlights of new technologies introduced at WWDC 2021 by myko on Monday June 07, 2021 @09:12PM (#27429505)
I still don't understand why I'd want to use async/await in a mobile/desktop app over something like Rx (Combine). Is there a good rundown on when to use one or the other?
Re:Highlights of new technologies introduced at WWDC 2021 by guacaswole on Tuesday June 08, 2021 @06:17AM (#27432761)
I wondered the same thing actually. After I read about async await I thought “Well, what’s the point in Combine then?”
Re:Highlights of new technologies introduced at WWDC 2021 by akmarinov on Tuesday June 08, 2021 @12:57PM (#27437724)
It’s your choice - you want Rx - you do Rx. Everyone gets something.
Re:Highlights of new technologies introduced at WWDC 2021 by myko on Wednesday June 09, 2021 @10:24AM (#27448216)
Yes but my question is more about what tradeoffs should I be looking for to decide which to use. There does not seem to be a simple way to bridge the worlds, so deciding early is probably necessary.

From what I'm gathering I should stick to Rx (Combine) when I have multiple related tasks or want to fire off changes in response to events, whereas async/await is useful for one-off asynchronous tasks like most web requests? I'm really not sure.

Re:Highlights of new technologies introduced at WWDC 2021 by elpakal on Monday June 07, 2021 @10:13PM (#27429881)
also interested in async vs combine, but i’m the other way around - unless you want to fight for rx programming i see Combine being in a very weird place. it looks like existing Foundation stuff will be easy to change to async, and for teammates without rx experience Combine can be a big mental model shift. plus Combine doesn’t compile on Linux, which is a big deterrent for me when thinking about how I might want to approach a Swift command line app.
Re:Highlights of new technologies introduced at WWDC 2021 by dmitriid on Tuesday June 08, 2021 @02:36AM (#27431290)
async/await are trivial to understand and use.

Anything Rx beyond the simplest of examples? Nope.

Re:Highlights of new technologies introduced at WWDC 2021 by myko on Wednesday June 09, 2021 @10:25AM (#27448241)
Rx is very powerful and can be difficult to understand at first, especially if you haven't done a lot of programming in functional languages before.

I'm not trying to argue about that though - I just want to know under what set of circumstances I should prefer async/await over Rx and vice versa.