DEV Community

Discussion on: You don't need a library for state machines

Collapse
 
aurelmegn profile image
Aurel

There is a more Object oriented approach using the State design pattern. It helps to have a cleaner code (en.wikipedia.org/wiki/State_pattern)

Collapse
 
davidkpiano profile image
David K. 🎹

Right; if you want to use OOP, you can. It's basically the same thing as switch-case + functions (substitute methods for functions).