State machines via enums give exhaustive matching and no dynamic dispatch, but trait objects are easier to extend. For a connection handler that has many states, which do you reach for first?
18
0 commentsState machines via enums give exhaustive matching and no dynamic dispatch, but trait objects are easier to extend. For a connection handler that has many states, which do you reach for first?