Turn it off and back on again.

Untangling a mess of spaghetti code can be the least enjoyable activity to think of doing on a Friday evening. None of the processes make sense, crashes are constant, and the flow of the program starts looking more like a maze than anything logical.

As a throwback towards A Level Computer Science, as well as a nod towards my current Systems and Software Engineering Principles module, Finite State Machines (FSMs) could be a big help.

In a very short description, an FSM is an abstract machine with a finite number of “states”: the condition the machine is currently in, or could be in. Different states are entered based on the outcome of events, allowing the machine to “transition” between these fixed states based on whether certain events have occurred.

While it’s definitely worth Googling, the real practicality is best summarised as:
“There’s nothing to say that you have to process all the state transitions at the same time. If you’re going through the steps to sign up a user on your app, there’s likely to be a number of transitions as they enter their details, validate their email, agree to the 107 different legislated warnings that online apps must now give, and so on.”

Thank you for reading, see you next week!