2 ms·
His only complaint seems to be race conditions, but callbacks have these too. In fact, coroutine based i/o use callbacks underneath just as while and for loops
by stevedekorte 14y ago
His only complaint seems to be race conditions, but callbacks have these too.
In fact, coroutine based i/o use callbacks underneath just as while and for loops use gotos (jump instructions) underneath.
The difference with both is that the abstraction allows your code to be more understandable and easily changed.
For example, try making randomly selected locations in your code async using callbacks - painfully difficult. Now try it with coroutines - easy.
There is a reason why we use stacks.