Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The issue with state you should handle it. Compare for example some iterator implementation in Java and Python. Latter needs only one method with coroutine and no state to store on object level.

> 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.



Fair that they are a way to implement without having to give more details. Those details are pushed to somewhere else, though. Which tends to make then less good for pedagogical reasons, to me. Also a bit harder to reason about to me, for some reason.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: