|
|
|
|
|
by stickfigure
1086 days ago
|
|
This is also nonsense. 99% of the time these failure modes are irrelevant. A remote call fails, the error propagates up the call stack, and someone gets an error message. Just like any of the thousands of other things that can produce errors in complex systems. In the rare case you need to harden a particular call, you add caching or retries or whatever other logic fits your use case. It matters not one bit whether you're using futures or synchronous rpc stubs. Actually it does - synchronous code is easier to harden because it's easier to reason about. Even javascript added await because it's better to pretend that async code looks synchronous. The failure semantics of "throws an exception" are just fine. |
|
Uh-huh, but did the message actually get through? Can they safely just retry? These are very uncommon failure modes on local systems but very common on networked systems. Without a proper stateful abstraction beyond just "procedure call", like a promise, you can't address these failure modes properly.
> In the rare case you need to harden a particular call, you add caching or retries or whatever other logic fits your use case
Which now makes your system nondeterministic like I said.
> Even javascript added await because it's better to pretend that async code looks synchronous
Yes, linear code is easier to read. I don't see what this has to do with anything. The use of promises and await indicates a possibility of failure semantics that would otherwise not be apparent in the program's control-flow.
Yes, you can superficially make this look like synchronous code, but it's not synchronous code.