Shifting meanings: "Spaghetti Code"?
Sridhar Ayengar
ploopster at gmail.com
Thu Aug 16 12:06:11 CDT 2007
Chuck Guzis wrote:
> In an EETimes online article today, I read the following paragraph:
>
> "Among its other features, Morrison said COSA allows more dynamic
> changes in software than traditional methods, enables fast pre-
> empting of threads and brings a new level of traceability to
> processes. It is also easier to debug because it does not use the
> structures of nested if-then-else statements known as spaghetti code
> popular in conventional programming languages."
>
> Nested "IF-THEN-ELSE" is now spaghetti code? I'd always understood
> the term to mean code with lots of conditional GOTO statements (In
> FORTRAN, sprinkle in a bunch of computed and assigned GOTOs and
> you're talking real pasta).
>
> When did the meaning change? Was it when the GOTO statement was
> pretty much deprecated in just about every modern programming
> language? I can recall when "structured programming" was popularly
> held to mean "no GOTOs".
I don't think the meaning has changed. I think the person who was
talking doesn't really know spaghetti code when he sees it. I draw the
line at computed GOTO. I wouldn't even consider conditional GOTO to be
"spaghetti".
Although, I might consider assembler code where every second instruction
is a jump to be spaghetti code.
Peace... Sridhar
More information about the cctalk
mailing list