Spaghetti code

From CSSEMediaWiki
Jump to: navigation, search

Spaghetti code is a common term for complicated and convoluted code that is difficult to understand and maintain. It is called spaghetti code because the control flow of the code looks like spaghetti and goes all over the place.

Spaghetti code can be caused by a number of things including excessive and unstructured use of GOTO statements and objects accessing each other's internal parts. Inexperienced programmers sometimes tend to write spaghetti code when they first learn to program.

Liabilities

  • Makes a system hard to understand.
  • Makes a system hard to maintain because it is difficult to understand and because bugs are difficult to trace.

See also

Personal tools