4 ms·
I feel like the majority of problems that are resolved with power cycling could be prevented on the engineering side if engineers merely understood state machin
by saosebastiao 11y ago
I feel like the majority of problems that are resolved with power cycling could be prevented on the engineering side if engineers merely understood state machines better.
The reason why power cycling works at all is because the machine's state is inconsistent with the program's, and power cycling gives the machine and the program a chance to start over from scratch.
So many programs out there, especially so in embedded devices where power cycling is common, don't really have an explicit state machine model of operation. As such, the debugging of these types of errors is near impossible. If you have an explicit state machine model of operation, and you have a bug that is remedied by a power cycle, you can quite easily trace the bug back to a specific state transition. Of course, this becomes more untenable with increases in system and hardware complexity, but on the level of a driver or a single executable, an explicit state machine model works wonders.