Part of the Programming glossary:

Spaghetti code is a derogatory term for computer programming that is unnecessarily convoluted, and particularly programming code that uses frequent branching from one section of code to another. Spaghetti code sometimes exists as the result of older code being modified a number of times over the years.

Another part of the spaghetti analogy is the way that making a change to one part of the code can have unpredictable effects on the rest of the program, just as pulling on one strand of spaghetti can affect other strands of spaghetti that in ways that are not foreseeable. Techniques such as data hiding are often used to prevent similar problems in coding.

Procedural programming languages, such as COBOL and FORTRAN, depend upon the skill and diligence of the programmer to avoid ending up with spaghetti code. A subset of procedural programming known as structured programming, which enforces a structure within the code, was developed to circumvent such problems.

Spaghetti code or any type of hard-to-understand code is sometimes referred to as write-only code. Other variations on the Pasta Theory of Programming include lasagna code, which is likened to structured programming, and ravioli code, which is favored and likened to object-oriented programming (OOP).

This was last updated in October 2008
Contributor(s): Ronald S. Davis
Posted by: Margaret Rouse

Related Terms

Definitions

  • use case diagram

    - A use case diagram is a graphic depiction of the interactions among the elements of a system. A use case is a methodology used in system analysis to identify, clarify, and organize system requireme... (WhatIs.com)

  • domain specific language (DSL)

    - A domain specific language (DSL) is a programming language developed to address an aspect within a specific domain. (SearchSOA.com)

  • Java Champion

    - The Java Champion designation is awarded to leaders and visionaries in the Java technology community. (SearchSOA.com)

Glossaries

  • Programming

    - Terms related to software programming, including definitions about programming languages and words and phrases about software design, coding, testing and debugging.

  • Internet applications

    - This WhatIs.com glossary contains terms related to Internet applications, including definitions about Software as a Service (SaaS) delivery models and words and phrases about web sites, e-commerce ...

Ask a Question About spaghetti codePowered by ITKnowledgeExchange.com

Get answers from your peers on your most technical challenges

Tech TalkComment

Share
Comments

    Results

    Contribute to the conversation

    All fields are required. Comments will appear at the bottom of the article.