by bmitc · 5y ago · 0 comments
This article is pretty terrible. There isn't even a functional implementation, with just a half hearted attempt to even understand how to do it.
Functional languages excel at state machines. The example is pretty terrible too with regards to imperative programming being a good fit, because literally no one enjoys the real life statefulness and mutation when cooking. If you mess up, there's no going back. Why would you want to embrace or repeat that feature in your implementation? Functional state machines just pass explicit state around instead of mutating some random collection of variables.
And god, those C++ examples make me nauseous.