Category: 

What is the Pasta Theory of Programming?

Article Details
  • Written By: Malcolm Tatum
  • Edited By: Bronwyn Harris
  • Last Modified Date: 25 September 2016
  • Copyright Protected:
    2003-2016
    Conjecture Corporation
  • Print this Article
Free Widgets for your Site/Blog
The atmosphere of Jupiter's moon Io collapses every time it is eclipsed by the planet.   more...

September 29 ,  2008 :  The Dow Jones Industrial Average experienced its largest one-day drop in history.  more...

The pasta theory of programming has to do with the complexity of various programming structures. Just as pasta comes in many different sizes and shapes, the same is true with programming code. With a pasta theory, a particular type of pasta is used as a colorful illustration to identify some aspects associated with a particular set of programming protocols.

One excellent example of a pasta theory of programming is the spaghetti code. Cooked spaghetti is often served as a collection of strands that cross over and intertwine with one another. It is practically impossible to extract one strand of spaghetti without causing some degree of disturbance to the other strands.

With this type of pasta theory, it is understood that the programming effort is somewhat happenstance and chaotic. There is little or no real structure to the programming code. The end result is that attempting to modify the code associated with one portion of the sequence often creates unanticipated problems with another part of the code. As a result, a spaghetti code is extremely hard to understand in terms of logical progression and equally difficult to modify without creating new problems.

Ad

By contrast, the pasta theory of programming can also refer to programming that is highly structured. One example of this type of theory is known as the lasagna code. Lasagna is a layered pasta dish, with ingredients placed deliberately and consistently between the layers of lasagna noodles. The end result is a pasta dish that is uniform throughout and is easily broken down into identifiable components.

When the pasta theory or programming uses the term lasagna code to refer to a programming effort, it is spotlighting the logic and order that appears to govern the entire structure of the code involved. It is possible to modify sections of the code without creating an unanticipated reaction somewhere later in the code processing. Logical progression and sequencing are hallmarks of a lasagna code, making it an opposite of the more chaotic spaghetti code.

The concept of the pasta theory of programming is typically attributed to Raymond Rubey. In a letter he wrote to a trade magazine in 1992, Rubey used terminology related to ravioli and spaghetti to refer to programming strategies and situations. The general idea of a pasta theory of programming caught on and soon various programming methods began to be labeled by many programmers using various types of pasta. In some cases, the selection of pasta names pointed toward beneficial attributes of a given programming code approach, while others referred to programming methods that were considered to be less efficient and structured

Ad

You might also Like

Recommended

Discuss this Article

Post your comments

exception 'Exception' with message 'error writing captcha: Duplicate entry '2147483647' for key 'PRIMARY'' in /ssd/www/wisegeek/public_html/_core/classes/public/Captcha.php:44
Stack trace:
#0 /ssd/www/wisegeek/public_html/_core/controls/public/ControlDiscussionPostBox.php(324): Captcha->createCaptcha()
#1 /ssd/www/wisegeek/public_html/framework/classes/Control.php(104): ControlDiscussionPostBox->preRender(false)
#2 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): Control->render()
#3 /ssd/www/wisegeek/public_html/tpl/default-nocustom-lu/pages/public/article/article.htm(526): Control->__toString()
#4 /ssd/www/wisegeek/public_html/framework/classes/Control.php(300): require('/ssd/www/wisege...')
#5 /ssd/www/wisegeek/public_html/framework/classes/Control.php(309): Control->requireTpl('pages/public/ar...', Object(PageArticleCom), true)
#6 /ssd/www/wisegeek/public_html/framework/classes/Control.php(131): Control->renderTpl('pages/public/ar...', Object(PageArticleCom))
#7 /ssd/www/wisegeek/public_html/framework/classes/FormDataControl.php(87): Control->renderTemplate()
#8 /ssd/www/wisegeek/public_html/framework/classes/Control.php(109): FormDataControl->renderTemplate()
#9 /ssd/www/wisegeek/public_html/framework/classes/ScriptPage.php(50): Control->render(false)
#10 /ssd/www/wisegeek/public_html/framework/classes/Control.php(149): ScriptPage->render()
#11 /ssd/www/wisegeek/public_html/framework/classes/Page.php(97): Control->__toString()
#12 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(443): Page->processRequest()
#13 /ssd/www/wisegeek/public_html/_core/classes/public/PublicFrontController.php(7): PublicFrontController->renderPage()
#14 /ssd/www/wisegeek/public_html/index.php(11): PublicFrontController::run()
#15 {main}