4 ms·
obviously, as long as the language is turing complete, but you just converted an unstructured program to a structured one.
by m_mueller 5y ago
obviously, as long as the language is turing complete, but you just converted an unstructured program to a structured one.
- maskros 5y agoAnd gained nothing except more verbose syntax. The goto spaghetti is still spaghetti whether you use "goto" or "switch".
- m_mueller 5y agoDisagree. You eliminate backward gotos except for the while loop, which is much more clearly communicating the way to extend the code (by adding more states or state transitions) to the next person taking over. I‘m not categorically against goto in certain contexts (like C based systems programming), but IMO backwards jumps with goto need to be eliminated.
- lmm 5y agoTo the same extent, and in the same way, as you did when you converted a state machine the same way? I still don't get what distinction you're drawing between state machine style and GOTO style.