Spaghetti code

Code being developed with poor structure can be due to any of several factors, such as volatile project requirements, lack of programming style rules, and software engineers with insufficient ability or experience.

[12] In a 1981 computer languages spoof in The Michigan Technic titled "BASICally speaking...FORTRAN bytes!!

[13] Richard Hamming described in his lectures[14] the etymology of the term in the context of early programming in binary codes: If, in fixing up an error, you wanted to insert some omitted instructions then you took the immediately preceding instruction and replaced it by a transfer to some empty space.

Indentation is not used to differentiate the various actions performed by the code, and the program's GOTO statements create a reliance on line numbers.

Real-world occurrences of spaghetti code are more complex and can add greatly to a program's maintenance costs.

Here is the same code written in a structured programming style: The program jumps from one area to another, but this jumping is formal and more easily predictable, because for loops and functions provide flow control whereas the goto statement encourages arbitrary flow control.