I have seen in many forums and technical sites the expression "Code of our project is spaghetti"
What is the meaning of this expression?
I have seen in many forums and technical sites the expression "Code of our project is spaghetti"
What is the meaning of this expression?
Simply that is is messed up and convoluted and intertwined and hard to trace an individual strand.
"Spaghetti code" means that the flow/branching in your code is intertwined.
You can see spaghetti code anytime you can have trouble following the flow of your program. Some examples are with gotos, exceptions, threads, or other branching mechanisms available in your programming language.
An example with gotos:
//now entering spaghetti code...
label1:
//some code
goto label3;
label2:
//some code
goto label4;
label3:
//some code
goto label2;
label4:
//now leaving spaghetti code...
See Wikipedia for more examples on spaghetti code and for other pasta coding terms less commonly used :).
Large monolithic programs are like a plate of spaghetti; pull it here and something moves on the other side.
This is the earliest reference I know of the spaghetti code simile. It's from Program Style, Design, Efficiency, Debugging, and Testing (1974) by Dennie Van Tassel.
Spaghetti code refers to code that is so intricate and poorly organized that changing any part of it is likely to affect functionality other than that which you intended to change.