DEV Community

Discussion on: Status instead of isLoading boolean?

Collapse
 
myleftshoe profile image
myleftshoe

Agreed, a state machine in this case would be overkill. Compare time and mental load to

  1. write out some if statements (virtually no mental load) vs
  2. think about representing the logic as a state machine, draw a state diagram, etc

Not only that but the code would be harder for others to grok than if statements and would make them wonder why it was implemented as a state machine - "I must be missing something"

And if you were a contractor, paid by the hour, using a state machine in this case would look like that you were milking your hours and using your time to experiment or hone your skills