Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Spaghetti code
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== History == It is not clear when the phrase spaghetti code came into common usage; however, a references appeared in 1972 including ''The principal motivation behind eliminating the goto statement is the hope that the resulting programs will not look like a bowl of spaghetti.'' by [[Martin E. Hopkins.|Martin Hopkins]].<ref>Hopkins, M. E. (1972): A Case fo the GOTO. In: ACM '72: Proceedings of the ACM annual conference - Volume 2, August 1972, pp 787–790, p 59 DOI:https://dl.acm.org/doi/10.1145/800194.805860</ref> In the 1978 book ''A primer on disciplined programming using PL/I, PL/CS, and PL/CT'', [[Richard W. Conway|Richard Conway]] described programs that "have the same clean logical structure as a plate of spaghetti",<ref>{{cite book|title=A primer on disciplined programming using PL/I, PL/CS, and PL/CT|last=Conway|first=Richard|publisher=Winthrop Publishers|year=1978|isbn=978-0-87626-712-7}}</ref><!-- page 186 --> a phrase repeated in the 1979 book ''An Introduction to Programming'' he co-authored with [[David Gries]].<ref>{{cite book|title=An Introduction to Programming|last1=Conway|first1=Richard|last2=Gries|first2=David|edition=3rd|publisher=Little, Brown|year=1979|isbn=978-0-316-15414-7}}</ref><!-- page 158 --> In the 1988 paper ''A spiral model of software development and enhancement'', the term is used to describe the older practice of the ''code and fix model'', which lacked planning and eventually led to the development of the [[waterfall model]].<ref>{{cite journal|journal=IEEE Computer|title=A spiral model of software development and enhancement|last=Boehm|first=Barry W.|volume=21|issue=2|date=May 1988|pages=61–72|doi=10.1109/2.59|s2cid=1781829}}</ref><!-- page 63 --> In the 1979 book ''Structured programming for the COBOL programmer'', author Paul Noll uses the phrases ''spaghetti code'' and ''rat's nest'' as synonyms to describe poorly structured source code.<ref>{{cite book|title=Structured programming for the COBOL programmer: design, documentation, coding, testing|last=Noll|first=Paul|publisher=M. Murach & Associates|year=1977}}</ref><!-- page 15 --> In the ''Ada – Europe '93'' conference, [[Ada (programming language)|Ada]] was described as forcing the programmer to "produce understandable, instead of spaghetti code", because of its restrictive exception propagation mechanism.<ref>{{cite conference|conference=Ada – Europe '93 (Proceedings)|book-title=Lecture Notes in Computer Science|title=Use and abuse of exceptions — 12 guidelines for proper exception handling|last=Schwille|first=Jürgen |series=Lecture Notes in Computer Science |volume=688|year=1993|publisher=Springer Berlin Heidelberg|pages=142–152|doi=10.1007/3-540-56802-6_12|isbn=978-3-540-56802-5 }}</ref> In a 1981 computer languages spoof in ''The Michigan Technic'' titled "BASICally speaking...FORTRAN bytes!!", the author described [[FORTRAN]] stating that "it consists entirely of spaghetti code".<ref>{{cite journal|journal=The Michigan Technic|title=BASICally speaking...FORTRAN bytes!!|author=MTSBS{{clarify|date=April 2015}}| volume=99|issue=4|date=March–April 1981}}</ref><!-- page 18 --> [[Richard Hamming]] described in his lectures<ref>{{cite book |last1=Hamming |first1=Richard |title=The Art of Doing Science and Engineering |date=1996 |publisher=Taylor & Francis |isbn=9056995006}}</ref> the etymology of the term in the context of early programming in binary codes: {{Quote |text=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. There you put in the instruction you just wrote over, added the instructions you wanted to insert, and then followed by a transfer back to the main program. Thus the program soon became a sequence of jumps of the control to strange places. When, as almost always happens, there were errors in the corrections you then used the same trick again, using some other available space. As a result ''the control path of the program through storage soon took on the appearance of a can of spaghetti.'' Why not simply insert them in the run of instructions? Because then you would have to go over the entire program and change all the addresses which referred to any of the moved instructions! Anything but that! }}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)