Geek: co-routines and state machines do basically the same thing... I've never had occasion to investigate co-routines, as I've never written programs in a language that supports them intrinsically. But as I read this article and thought about it, I realized that my implementations of state machines in languages like Java, C, or assembly were basically indistinguishable from a co-routine implementation in the same language. So ... languages that intrinsically support co-routines are actually also intrinsically supporting state machines.
State machines are one of my favorite programming techniques for dealing with a messy real world with minimum complexity. This makes me want to investigate Ruby – and nothing else I've ever read about Ruby did that :)
No comments:
Post a Comment