Ben Cohen on Nostr: npub1srcgh…xfms4 very nice re the reference cycle concern – the questioner sounds ...
npub1srcgh979ychudzrha7asxa7kvennpghghzzadmv5gcunfw5p72qs6xfms4 (npub1src…fms4) very nice
re the reference cycle concern – the questioner sounds like they were using to Swift when the main way to do async stuff was with callbacks and delegates, which force you to rely heavily on weak references in lots of places to avoid cycles. transitioning to async/await and structured concurrency makes this much better. you still need weak references occasionally, like for some data structures, but that's much more "this is the right tool for the job” kind of thing.
re the reference cycle concern – the questioner sounds like they were using to Swift when the main way to do async stuff was with callbacks and delegates, which force you to rely heavily on weak references in lots of places to avoid cycles. transitioning to async/await and structured concurrency makes this much better. you still need weak references occasionally, like for some data structures, but that's much more "this is the right tool for the job” kind of thing.