Ah! Blood pressure rising!
> Like with goto, the common advice is to avoid
Whew. And then goes on to make a really good case for complicated task perform with simple error handling.
It’s a good application for not exactly general use cooperative routines but a specific use case of performing multiple procedural steps.
I think there it falls short and where an RTOS/OS will be more useful is when you have to wait on one of those steps.
I think that’s the harder example with the example of an HTTP request is waiting for the response and keeping that context ready and blocking in a separate thread. That ends up being easy to read and maintainable. But I suppose there is no reason you can’t do both.