- Advertisement -

- Advertisement -

OHIO WEATHER

Spaghetti code: Difference between revisions


From Wikipedia, the free encyclopedia


 

Line 1: Line 1:

{{short description|Software source code with poor structure}}

{{short description|Software source code with poor structure}}

”’Spaghetti code”’ is a [[pejorative]] phrase for unstructured and difficult-to-[[Software maintenance|maintain]] [[source code]]. Spaghetti code can be caused by several factors, such as volatile [[Software project management|project]] requirements, lack of [[programming style]] rules, and [[software engineer]]s with insufficient ability or experience.{{cite journal|last1=Markus|first1=Pizka|title=Straightening spaghetti-code with refactoring?|journal=Software Engineering Research and Practice|date=2004|pages=846–852|url=http://itestra.com/wp-content/uploads/2017/08/04_itestra_straightening_spaghetti_code_with_refactoring.pdf|access-date=5 March 2018|archive-date=5 March 2018|archive-url=https://web.archive.org/web/20180305202716/http://itestra.com/wp-content/uploads/2017/08/04_itestra_straightening_spaghetti_code_with_refactoring.pdf|url-status=dead}}

”’Spaghetti code”’ is a [[pejorative]] phrase for unstructured and difficult-to-[[Software maintenance|maintain]] [[source code]]. Spaghetti code can be caused by several factors, such as volatile project requirements, lack of [[programming style]] rules, and [[software engineer]]s with insufficient ability or experience.{{cite journal|last1=Markus|first1=Pizka|title=Straightening spaghetti-code with refactoring?|journal=Software Engineering Research and Practice|date=2004|pages=846–852|url=http://itestra.com/wp-content/uploads/2017/08/04_itestra_straightening_spaghetti_code_with_refactoring.pdf|access-date=5 March 2018|archive-date=5 March 2018|archive-url=https://web.archive.org/web/20180305202716/http://itestra.com/wp-content/uploads/2017/08/04_itestra_straightening_spaghetti_code_with_refactoring.pdf|url-status=dead}}

== Meaning ==

== Meaning ==


Latest revision as of 17:58, 28 April 2023

Software source code with poor structure

Spaghetti code is a pejorative phrase for unstructured and difficult-to-maintain source code. Spaghetti code can be caused by several factors, such as volatile project requirements, lack of programming style rules, and software engineers with insufficient ability or experience.[1]

Meaning[edit]

Code that overuses GOTO statements rather than structured programming constructs, resulting in convoluted and unmaintainable programs, is often called spaghetti code.[2]
Such code has a complex and tangled control structure, resulting in a program flow that is conceptually like a bowl of spaghetti, twisted and tangled.[3]
In a 1980 publication by the United States National Bureau of Standards, the phrase spaghetti program was used to describe older programs having “fragmented and scattered files”.[4]
Spaghetti code can also describe an anti-pattern in which object-oriented code is written in a procedural style, such as by creating classes whose methods are overly long and messy, or forsaking object-oriented concepts like polymorphism.[5] The presence of this form of spaghetti code can significantly reduce the comprehensibility of a system.[6]

History[edit]

It is not clear when the phrase spaghetti code came into common usage; however, several references appeared in 1977 including Macaroni is Better Than Spaghetti by Guy Steele.[7] In the 1978 book A primer on disciplined programming using PL/I, PL/CS, and PL/CT, Richard Conway used the term to describe types of programs that “have the same clean logical structure as a plate of spaghetti”,[8] a phrase repeated in the 1979 book An Introduction to Programming he co-authored with David Gries.[9] 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.[10] 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.[11]

In the Ada – Europe ’93 conference, Ada was described as forcing the programmer to “produce understandable, instead of spaghetti code”, because of its restrictive exception propagation mechanism.[12]

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”.[13]

Richard Hamming described in his lectures[14] the etymology of the term in the context of early programming in binary codes:

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…



Read More: Spaghetti code: Difference between revisions

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy

Get more stuff like this
in your inbox

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.