|
|
|
|
|
by taeric
252 days ago
|
|
But coroutines really only work any better than "objects" if you understand the implication to the stack pointer? Which requires understanding exactly what a thread is. Right? That is, a basic class that has defined state and methods to modify the state is already enough to explain a state machine. What makes coroutines better for it? |
|
> the state is already enough to explain a state machine.
I did not talk about explaining state machines but implementing state machines as coroutines. Progression: give an idea of state machines, show how hard is to handle state, present coroutines as way to handle states.