Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

2
  • Or none of those. A state machine can be created easily inside a function. Simple if/else is good enough but verbose, the actions can be passed as Action or Func parameters to a function and pattern matching can convert the transitions to a single expression. Commented Oct 2, 2020 at 16:18
  • sure, that's why I ugh at the beginning, coz there is no right or wrong in such a question, just how you want to write and read your code, and you think it's easiest to test your individual logic, completely personal preference. Commented Oct 2, 2020 at 16:42