Talk:Spaghetti code

message: Is what 199.29.247.140 added really spaghetti code? I'd just call it bad code, because there's no noodle like loops of goto-ing and whatnot...
--Carl 13:49, 13 Oct 2004 (UTC)
replies: text: I agree. It's hardly a good example of spaghetti code. I removed it. --Neg 01:21, 27 Nov 2004 (UTC)

text: I guess looking at the spaghetti aids in understanding the chaotic nature of spaghetti code. Plus its humourous so why not. JesseHogan 07:56, 15 July 2005 (UTC)

text: Those pictures are much in help to understand what spaghetti code is. There could be bowl of Ravioli picture too, coz i don't know what ravioli is, so will have to search for it seperately Kiaurutis (talk) 21:20, 7 February 2011 (UTC)
thread_title:  199.29.247.140 Example? 

message: A variation of spaghetti code with unreadable and/or outdated and misleading comments.
Often includes numerous macros that call other macros that modify global variables.
: PJTraill 15:59, 8 April 2006 (UTC)
thread_title:  Lo-mein code 

message: I don't believe the 2 code fragments really illustrate spaghetti code in a fair way: it makes it seem as though the older style of BASIC, especially the line numbering, is the problem. The 2 code fragments should ostensibly be be written in the same style. I like seeing the BASIC, lord knows it facilitated more than its share of bad code, but as I no longer have access to an interpreter I don't think I can come up with a fully functional "structured" example. Ewlyahoocom 18:53, 11 February 2006 (UTC)
thread_title:  NPOV: line numbering 

message: Just try to figure out how this baby gets the sorting done (it looks like shell sort). It's converted from BASIC to QBASIC. I think it as from a library book I once read when I was little. --Zom-B 00:12, 05 November 2006 (UTC)
thread_title:  Another example 

message: I'm looking for the proper terminology that describes code that isn't a jumbled mess per se, but is hard to decouple or modularize. Perhaps this goes hand-in-hand with spaghetti code, but for example monolithic kernel doesn't seem to imply sloppy coding practice. Can the article be made to clarify if and how these things are different? Ham Pastrami (talk) 12:18, 3 April 2008 (UTC)
replies: text: My aunt has been programming when the term was coined, and according to her the term spaghetti code means exactly that and has no connection to control flow at all. The metaphor makes *much* more sense this way: When you have a lump of spaghetty, pulling at any specific noodle will get you the whole ball.  —Preceding unsigned comment added by 84.187.101.243 (talk) 01:17, 3 July 2008 (UTC)

text: Bollocks. Spaghetti code means a tangled indecipherable mess. That's what it has always meant. 194.213.49.62 (talk) 14:37, 30 January 2012 (UTC)
replies: text:  NO, they are different things. Monolithic refers to the modular structure of a program. More clearly when there is just one module. Although one can divide the program in several modules, those modules may not be of general use. In such case the program is logically monolithic.  I hope that those programs are unthinkable for today programmers, because the majority learn OO languages, where modularization and encapsulation is the normal design in the mind of the programmer.  For the spaghetti, code see my comment about "spaghetti flow diagrams."  — Preceding unsigned comment added by 189.178.45.137 (talk) 05:28, 31 January 2016 (UTC)
thread_title:  Spaghetti code vs monolithic code 

message: The 2 edits by 81.226.168.117 on 11 February 2007 seem to have "fixed" the example of bad code, by putting the commands in a logical order, the same as if it used FOR loops. It is now fairly readable, and its operation obvious, which surely defeats the object of the example, which is meant to show the confusing nature of spaghetti code. I suggest it should be changed back. 131.111.197.43 (talk) 17:56, 22 October 2008 (UTC)
thread_title:  The Example 

message: The rims on the dish in the picture raise up, you see. If the dish were a plate, the rims would be on nearly the same level of the base of the dish. But they're not. The dish is very clearly a bowl. Is it possible someone change this? 71.238.211.166 (talk) 20:04, 29 November 2008 (UTC)
replies: text: i don't agree. the pasta pictures bring some humour and good analogies to the technicalities of "spaghetti, ravioli and lasagna code". love it! --Phneutral (talk) 11:53, 4 October 2011 (UTC)
thread_title:  The plate of spaghetti is technically a bowl of spaghetti. 

message: Does anyone know of a source that defines "Spaghetti with Meatballs"?  I've been looking but I can't find one and I think one should be added. 173.79.74.195 (talk) 03:57, 17 October 2011 (UTC)
thread_title:  Source for "Spaghetti with meatballs" 

message: I think the example of "Spaghetti code" is meek - it's if the example given doesn't quite qualify, since it is just the goto version of a for loop. Examples of real spaghetti code should instead provide violation of best practice programming structures, such as jumps into loops, worse, jumps into a block from outside, elaborate 8-loops (instead of a round loop), and select (switch, case depending on language) clauses emulated by goto and abnormal jumps within that select clause. I've programmed in such code once, created by an optimistic non-programmer. Rursus dixit. (mbork3!) 14:14, 11 March 2012 (UTC)
replies: text: I'm not sure what your point here is. It seems like the results are the same. Or is your point that the "spaghetti" example is really not an example of spaghetti at all? I agree with you, it would not have been spaghetti in some year before BASIC had a FOR loop; but today, I think it would qualify as such. Nobody said GOTOs are from the devil, they do have their uses (few and far between as they are). On the contrary, I actually think this is a good simple example of how you can use constructs of a language to make a program more spaghetti-like or less spaghetti-like. You are welcome to add your own example of spaghetti and non-spaghetti code. Fool4jesus (talk) 19:54, 11 September 2012 (UTC)

text: I agree that the example is pretty weak. This is sadly very common when spaghetti code is explained. It often gives the impression that the gotos themselves causes spaghetti code, which is certainly not the case. In this case, the spaghetti example is not complex enough to fully show the problem. If I should propose a very naïve definition of spaghetti code, I would propose "code that cannot be transformed into high-level loops with ease". 192.71.194.251 (talk) 09:31, 4 April 2017 (UTC)
thread_title: Example again

message: Of assembly languages, the article says, "... they are low-level programming languages where equivalents for structured control flow statements such as for loops and while loops exist, but are often poorly understood by inexperienced programmers." Is this true? I thought for and while statements were emulated through conditional branching. --Allen (talk) 21:56, 22 December 2012 (UTC)
thread_title:  assembly languages have for and while statements? 

message: It's pretty silly that the article gives an exact year when the tangential phrase 'lasagna code' was coined, while nothing at all is said about the origin of the term covered by the main article, "spaghetti code". Or what am I missing?  Toddcs (talk) 21:54, 12 November 2013 (UTC)
replies: text: Probably because nobody ever bothered researching it or adding it to Wikipedia. I've added a history section, though I doubt it covers the earliest use, and misses much of the term's use from the 1960s and early 1970s. Mindmatrix 01:07, 13 November 2013 (UTC)
thread_title: Lasagna Code

message: Hi, folks.  I just added a new section on "macaroni code," but I'm now having second thoughts because the term does not appear to be in common usage.  Google's Ngram viewer indicates that it was far more common in the 1950s: https://books.google.com/ngrams/graph?content=macaroni+code but not what it meant at that time.  The only other definition for the term I can find is this one: http://theburningmonk.com/2010/01/buzzword-buster-macaroni-code/ which differs from the one I have provided.
Before you reflexively delete my addition, though, please consider the article on Macaronic language that inspired the edit, so you can see where I'm coming from.  I believe the HTML/PHP/SQL/JavaScript example I have provided is at least as macaronic as any of the examples given in that article, and so even though the term is not in common usage, I feel that it belongs in the article.
Note, for instance, that the terms "ravioli code" and "lasagna code" are not found in any of the books Google has indexed: https://books.google.com/ngrams/graph?content=ravioli+code%2Clasagna+code  — Preceding unsigned comment added by Ben Stallings (talk • contribs) 18:46, 7 January 2014 (UTC)
thread_title:  Macaroni code 

message: Spaghetti code is not just the use of GOTOs, one can write perfectly structured code using GOTOs, some correspond to the structures of decision (if-then-else) and iteration (while, repeat-until, for-next), other more complex correspond to coroutines. The problem with the use of GOTOs rely one it's origin. 
In the context of structured programming, one can design a program by composing the basic structures of imperative languages: assignment, decision, sequence, iteration, abstraction (the use of subroutines/functions).
The programmer has to ensure that the program, i.e. the composition of the instructions derived from those structures, transform the initial state of the program (according to the specification) to stop with a state which corresponds to the specified result. If the program was conceived in such way, then implemented in a language which lacks such structures, like the earl BASIC, Fortran, COBOL or an assembler, that does not mean that the program became spaghetti. Or in a more contemporary context, you can design a program using the continuation passing style, obtaining a program with GOTOs, but perfectly structured.
Previous to structured programming, the story was different, many programs were conceived drawing flow diagrams.
The programmers that used such technique did not follow the neat composing of instructions. The resulting flow diagrams, had a clumsy shape, hard to read, they were not planar graphs, because they could not be written without crossing lines. Those diagrams seem spaghetti, that is the origin of the term. The corresponding programs had lots of GOTOs, but one could not easily understand them, because it was not clear their structure. More over, on those days many programmers thought that the diagrams where sufficient to document the programs.
As far as I remember, a long time ago, this entry did not have such unfounded statements of different classes of pasta. Instead it had a picture of an spaghetti diagram, to illustrate what this term is about.
I ignore why it was deleted, maybe due to a justified reason like a copyright issue, or just for some kind of sabotage. If someone want to search in the history (about 15 years ago) to know why to restore it, that is one way, or you can work my explanation to rewrite this article. I am tempted to ask it's deletion.
:: See Assemblers and linkers (Part 2: The Assembly Process), p. 16 and Call graph - motion on calls inside sections/labels. RippleSax (talk) 09:29, 18 March 2016 (UTC)
thread_title:  Data flow diagrams and spaghetti code 

message: Without images of Spaghetti, the concept of Spaghetti code can be beyond utterly opaque for some Wiki readers. 
Failing to show images of this culinary oddity discriminates against many English as a 2nd Language readers, as this "Turing State Machine Concept" is really hard to understand even for a substantial and substantive percentage of the English global community.   
Wikipedia already has a long term and ongoing bad rap for being the Ground Zero for public opinion manipulation when it comes to entire classes of articles. 
There is no percentage yet derived, but possibly 10% to 22.5% of Wiki articles should not be read (or used) due to the beyond toxic manipulation originating from governments, corporations and religious groups. This includes a great number of scientific and technical articles that really should be exempted from this problem but because of the Wiki RealPolitik are not. 
This article should not be one of them... 
File:Pollo funghi spaghetti - Paesano Restaurant.jpg|Spaghetti con pollo e funghi
File:Spaghettata.JPG|Spaghetti pomodoro & basilico (tomato sauce and basil)
File:Spaghetti alle vongole.jpg|Spaghetti alle vongole
File:Spaghetti with Meatballs (cropped).jpg|Spaghetti with meatballs
Eyreland (talk) 03:15, 24 October 2018 (UTC)
thread_title:  Spaghetti images needed