What’s pasta programming theory?

Print anything with Printful



Pasta programming theory compares programming structures to different types of pasta. Spaghetti code is chaotic and difficult to modify, while lasagna code is structured and easy to understand. The concept was introduced by Raymond Rubey in 1992 and has been adopted by many programmers.

Pasta programming theory has to do with the complexity of various programming structures. Just as pasta comes in many different sizes and shapes, so does programming code. With a paste theory, a particular type of paste is used as a colored illustration to identify some aspect associated with a particular set of programming protocols.

An excellent example of a theory of pasta programming is spaghetti code. Cooked spaghetti is often served as a collection of strands that cross and intertwine with each other. It is virtually impossible to pull out a strand of spaghetti without causing some degree of disturbance to the other strands.

With this kind of dough theory, it is understood that the programming effort is somewhat random and chaotic. There is little or no real structure in programming code. The end result is that attempting to change the code associated with one part of the sequence often creates unforeseen problems with another part of the code. Consequently, spaghetti code is extremely difficult to understand in terms of logical progression and equally difficult to modify without creating new problems.

Conversely, pasta programming theory can also refer to highly structured programming. An 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. The end result is a homogeneous pasta dish that can be easily broken down into identifiable components.

When pasta theory or programming uses the term lasagna code to refer to a programming effort, it is highlighting the logic and order that seem to govern the entire structure of the code involved. Sections of the code can be changed without creating an unexpected reaction at some later point in the code processing. Logical progression and sequencing are the hallmarks of a lasagna code, making it an opposite of the more chaotic spaghetti code.

The concept of pasta programming theory is typically attributed to Raymond Rubey. In a letter he wrote to a trade magazine in 1992, Rubey used dumpling-and-spaghetti terminology to refer to programming strategies and situations. The general idea of ​​a theory of pasta 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 indicated beneficial attributes of a certain approach to programming code, while others referred to programming methods considered less efficient and structured




Protect your devices with Threat Protection by NordVPN


Skip to content