spaghetti code


Also found in: Dictionary, Thesaurus, Medical, Wikipedia.
Related to spaghetti code: Ravioli code

spaghetti code

[spə′ged·ē ‚kōd]
(computer science)
Computer program code that lacks a coherent structure, and in which the sequence of program execution frequently jumps to a distant instruction in the program listing, making the program very difficult to follow.
McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

spaghetti code

(programming)
A pejorative term for code with a complex and tangled control structure, especially one using many GOTOs, exceptions, or other "unstructured" branching constructs. The synonym "kangaroo code" has been reported, doubtless because such code has so many jumps in it.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)

spaghetti code

Program code written without a coherent structure. The logic moves from routine to routine without returning to a base point, making it hard to follow. It implies excessive use of the GOTO instruction, which directs the computer to branch to another part of the program without a guarantee of returning.

Although there are always ways around it, structured programming attempts to eliminate spaghetti code by using functions that, after being called and executed, return the computer to the instruction following the one that called it. See lasagna code, ravioli code and spaghetti development.


Spaghetti Code
There are tons of spaghetti code lurking in the millions of applications written over the years. Spaghetti code is often the result of being in a rush to make a change in the program or fix a problem.
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
References in periodicals archive ?
"These people think everything's going to be so much easier to maintain, that they're going to be able to get rid of spaghetti code for good with these distributed objects," he said, "but when you hop into your supersuit and fly up into space and look back down at these networks of distributed objects talking to each other, it all just starts to look like a bunch of spaghetti all over again."
The software is useful for untangling programming logic in spaghetti code, according to the developer, and for generating a visual document of an execution path.
"Pretty soon, you have what we call spaghetti code."