2 ms·
Non-structured programming relies on GOTOs. While some unstructured languages (e.g. BASIC, COBOL) do have subroutines, in general the program-flow goes all over
by simonblack 7y ago
Non-structured programming relies on GOTOs. While some unstructured languages (e.g. BASIC, COBOL) do have subroutines, in general the program-flow goes all over the place.
Structured languages rely more on 'if-then-else', 'do-while' or 'case' types of flow controls, where there is a constricted number of flows available. Coming from BASIC as my first-learned programming language, it took me a lot of effort to re-arrange my programs to eliminate all GOTOs.
If your code does not need to use a GOTO, it's flow is structured, and you have learned subconsciously (or you were taught) how to write structured programs rather than unstructured programs.
I once saw a diagram that showed how the program-flow formed nested loops in the code. The idea was that the program-flow should be written so one loop does not cross over another flow-line loop. The cartoon here ( https://encyclopedia2.thefreedictionary.com/Spaghetti+programming https://encyclopedia2.thefreedictionary.com/Spaghetti+progra... ) shows the crossing of flow-lines.