Eli Bendersky personal blog

Co-routines as an alternative to state machines (2009)

When you have to traverse some sort of a nested data structure (say, a binary tree), one approach is to create a stack that remembers where in the tree you are. Another, much more elegant approach, is to write the function recursively. A recursive function employs the machine stack used to implicitly implement…
Points
131
HN comments
100
Submissions
2
Cited by
5 commenters

Software EngineeringSystems & Performance2014

On Hacker News

SubmittedTitle on HNPointsComments
Apr 30, 2014Co-routines as an alternative to state machines (2009) by adamnemecek13169
Aug 29, 2009Co-routines as an alternative to state machines by gthank7331

Cited in comments

Linked from 7 Hacker News comments by 5 different people, from Oct 2010 to Jun 2025.

Most recent:

Search every comment that links here →

More from Eli Bendersky

All 57 posts →

Related posts from the same era