What is Spaghetti Code?
1.
In computer programming, code which flagrantly violates the principles of structured, procedural programming. Usually this means using lots of GOTO statements (or their equivalent in whatever language is being used) - hence the term, which suggests the tangled and arbitrary nature of the program flow.
Spaghetti code is almost impossible to debug and maintain, and rarely works well.
Programmers who write spaghetti code usually learned to code in an unstructured language such as BASIC, and never bothered to update their technical knowledge when they progressed to more serious languages.
You want me to debug this freaking spaghetti code? Please tell me you're kidding.
See
2.
The product of when some ignorant, over-confident fuckface writes in a hundred lines what you could write in a simple switch statement. This will undoubtedly include unneeded procedures and/or functions, unnecessary global variables, and unnecessarily abstracted include files. The purpose is to stroke the already inflated ego of said limp-dick programmer. And the result is that after management gets a clue and fires this jackass, you become the poor bastard who has to debug this pile of shit when it inevitably breaks down.
Security guard: What are you still doing here. It's seven o'clock. Shouldn't you be at home with your wife?
poor bastard: I'm still trying to figure out what the fuck Hank was trying to accomplish in this spaghetti code.
See
3.
A coding style often executed by
Holy moley look at that evil spaghetti code:
1 INT r=0
2 PRINT "moo"
3 r = r + 1
4 IF r<10{
5 GOTO 1
6 }
7 END
I'll just clear it up and magically start using C instead of BASIC because BASIC sucks.
1 for{r=0;r<10;r++){
2 printf("moo");
3 }
Great, now I better get back to my sexy lesbian orgy on fire.
See