Tech moves fast! Stay ahead of the curve with Techopedia!
Join nearly 200,000 subscribers who receive actionable tech insights from Techopedia.
Spaghetti code is a slang term used to refer to a tangled web of programming source code where control within a program jumps all over the place and is difficult to follow. Spaghetti code normally has a lot of GOTO statements and is common in old programs, which used such statements extensively.
The rise of more structured programming languages, like object-oriented programming languages, has reduced the prevalence of spaghetti code.
Old programming languages like BASIC, which featured GOTO statements, were highly susceptible to spaghetti code because programmers found it very convenient to direct control of the program from one area to another using the GOTO statements.
However, spaghetti code is dreaded by programming teams who are tasked to look into old programs because the program logic becomes very difficult to follow. Because it gives rise to complex code, the use of GOTO statements and spaghetti code is only convenient during the original development process.
The older a program gets which was written with spaghetti code, the more difficult it is for developers to follow, even the original developers.