I find making a state machine diagram before actually implementing an app is a really good approach because it forces you to think through the failure cases up front. What often happens toherwise is that you end up focusing on the happy case, and then error handling ends up being bolted on as you discover failure cases in production. This article is a great read on the subject https://shopify.engineering/17488160-why-developers-should-be-force-fed-state-machines
I mean, yeah, I wrote it kind of humorously up there, but I do actually think state diagrams are a good idea and modelling the known error paths is part of real software engineering.
However, I’ve never been in a project where anyone knew nearly enough about what we’re supposed to build, to be able to draw a state diagram before we got started. We would rather do a refactoring halfway through and then we would design a state machine to fit the requirements…
I find making a state machine diagram before actually implementing an app is a really good approach because it forces you to think through the failure cases up front. What often happens toherwise is that you end up focusing on the happy case, and then error handling ends up being bolted on as you discover failure cases in production. This article is a great read on the subject https://shopify.engineering/17488160-why-developers-should-be-force-fed-state-machines
I mean, yeah, I wrote it kind of humorously up there, but I do actually think state diagrams are a good idea and modelling the known error paths is part of real software engineering.
However, I’ve never been in a project where anyone knew nearly enough about what we’re supposed to build, to be able to draw a state diagram before we got started. We would rather do a refactoring halfway through and then we would design a state machine to fit the requirements…