Hacker News new | ask | show | jobs
by csb6 1215 days ago
One reason is to reduce callback hell where you have to pass a continuation function to an asynchronous operation to run after it has completed. Coroutines can be used to make your code look more like blocking code. ASIO’s coroutine support does this and it makes async operations much easier to read

Also, generators can be used to turn traversal functions into iterators, which is often tedious to do by hand.