Anyone that refactors code from another programmer has probably received some code that has too many sequence structures. Often I convert these to a simple state machine. With scripting this could be easily converted to a state machine for loop. A default enum type def could be created to do a state machine sequence 1 -> 2 -> 3 -> 4 ->5 -> ...last sequence in structure. All sequence locals could be replaced with either a local or a shift register (that will bypass all other cases where it is not used).
Why would I want this?
Sequences are over used and it is well documented that state machine architecture can provide many benefits over the static and simple sequence. Many programmers are un aware of these benefits and don't understand data flow so use sequences to force execution order. Sometimes sequences are convenient early in the prototyping only to find the known shortfalls of this programming paradigm. When this happend dont worry, just right click on the sequence structure and click convert to state machine. This could make refactoring code easier, at least in my mind (but is late on friday and I am ready for the weekend which could cloud my thought process).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.