What does the term lasagna code mean to you?

According to Wikipedia, the term was originally coined by database expert Joe Selco in 1982, and here is a quote from his 1997 article which shows what he meant by this: โ€œThe standard [structured programming] solution was to replace GOTO nested IF-THEN-ELSE statements and switches that were so deep and so redundant that you had a control path that looked like a plate instead of lasagna. "

However, the same Wikipedia entry defines the term differently, explicitly referring to multi-level applications: "... different subsystems, such as ... web application code, business logic, and a relational database." Thus, the term โ€œmeaningโ€ evolved as programmers developed new methodologies and architectures.

I can imagine two modern definitions of "Lasagna code":

  • layers of a software application that are excessive, over-engineered, or trivial (obviously)
  • Layers of software applications that do not have unit tests with proper isolation. The developers only tested the system, disassembling and consuming several layers at once.

The term obviously means criticism (just as you can criticize my stuff by calling it a "spaghetti code"). But what does this mean for you and when do you use it?

+4
source share
5 answers
+8
source

Too much goto == spaghetti code

Too much IF-THEN-ELSE / Switch == Climb Code

:)

+6
source

the spaghetti code on wikipedia has this to say

Climbing code is a type of program structure characterized by several clearly defined and separable layers, where each level of code accesses services in the underlying layers through well-defined interfaces. This term is compared to spaghetti code , comparing the structure of the program with pasta.

The analogy stems from the "strong" layered structure of the lasagna plate,
where the various ingredients (meat, sauce, vegetables or cheese) are separated by strips of pasta.

+2
source

The well-made lasagna, the kind that my wife makes, is well layered and neat, spaghetti, on the other hand, is a confusing mess, so I think the latter would be an insult, and the former would just be a way to describe code that was developed in isolated layers. I suppose MVC will be seen as a Lazanian programming approach, but that sounds silly and I will never use it. Also, if you told a live programmer that he was writing lasagna applications, you risk offending the poor guy.

It may also refer to code written by Italians. I suppose:)

+1
source

I had never heard of the lasagna code before, but the first thing that came to mind was the "spaghetti code." I assumed that part of it was everywhere, but most were a close-knit unit. Nice spaghetti code, but not good enough to not be called.

0
source

All Articles