Advertisement

Spaghetti code is good!

Started by April 19, 2001 08:12 AM
21 comments, last by exprt_prg 23 years, 9 months ago
haha hahaha hahahaha that was fun. Can''t stop hahahahaha.
hahahahahahahahahhah
Idiot! Enough said!

Windows 98/SE/ME SUCKS!
Deal with it!
if(windows crashes)
run Linux
else
yea right!!

Resist<br>Windows XP''s Invasive Production Activation Technology!

Advertisement
Any of you guys heard of that joke where you put some dog crap in a bag? You put it on someone''s door step and light it on fire then ring the bell. They come running to the door and stomp it out worried it''s serious. They just end up getting crap on their shoes and getting laughed at.

Half of you guys on this forum need to go wash your Nike''s off.

I''ll be back.
---------------------
Supervisor: Attention, whoever you are. This channel is reserved for emergency calls only...
John McClane: No fucking shit, lady! Do I sound like I''''m ordering a pizza?
I'll be back.---------------------Supervisor: Attention, whoever you are. This channel is reserved for emergency calls only...John McClane: No fucking shit, lady! Do I sound like I''m ordering a pizza?
c''mon this is rediculous
quote:
Original post by exprt_prg

spaghetti code is vastly underestimated. It is actually an advanced programming technique. You see, even though you have been told that it is a disgrace to the programmer to write such code, you have been lied to. In fact, I can present you with some reasons for it being good and I''m an expert.

1) Spaghetti code is much easier to write b/c goto statements are simpler that while loops and thealike
2) Spaghetti code is easier to read b/c you can just trace the goto statements whereas when you write strutcured code you have to follow the loops etc.
3) Spaghetti code is more natural b/c assembly is spaghetti code and you know what it translates to.

Trust me on this. I''ve been programming for 15 yrs and i only use spaghetti code. it works.


Listen up. You''re no expert. Cyberbrek is probably right: you''re some fifteen-year-old kid with an ego. Your arguments make absolutely no sense. Should I remind you that on the Internet, anyone can claim to be anything? Presenting "arguments" that have nothing to do with the central issue - organization - doesn''t satisfy the fundamental principles of debate.

It''s like bombing Reagan for his economic policy without noting that he helped end the Cold War.

quote:
Original post by Anonymous Poster

Should I remind you that on the Internet, anyone can claim to be anything? Presenting "arguments" that have nothing to do with the central issue - organization - doesn''t satisfy the fundamental principles of debate.

It''s like bombing Reagan for his economic policy without noting that he helped end the Cold War.




Eh, listen up you! I didn''t mean to end the cold war! Its not my fault those damn ruskies couldn''t manage their military and their economy at the same time... for christ sake I tried to prolong it! After all, I did increase the countries nuclear arsenal so that it could destroy the entire earth 500 times over!

and don''t forget that Iran contra thing! if those damn media type people didnt crucify ollie, it would have worked, damnit!

- Ronald Reagan
Advertisement


Eh, listen up you! I didn''t mean to end the cold war! Its not my fault those damn ruskies couldn''t manage their military and their economy at the same time... for christ sake I tried to prolong it! After all, I did increase the countries nuclear arsenal so that it could destroy the entire earth 500 times over!

and don''t forget that Iran contra thing! if those damn media type people didnt crucify ollie, it would have worked, damnit!

- Ronald Reagan


I knew it. You''re a no good dirt-bag that I should have tried harder to kill.

-Attempted assasin of Ronald Reagan .
quote:

there are no gotos in assembler, the JMP, JNZ, JZ, JNE, JE, etc are jumps according to a tested value( ie: an IF statement )



JMP is a straight up goto, no questions. So are all the conditional branches.

If (x==y)
goto here;

// is this how it''s done ? I haven''t done a goto in c yet

Still a goto really. All the Jumps do jump, honestly. I believe they change the values in the program counter (???) which holds the address of the next machine code instruction to execute.

El Duderino
spaghetti code is crap! The entire time i''ve been programing in c++ (3 yrs) i have used 1 goto, and that''s because that was the only choice.


"2) Spaghetti code is easier to read b/c you can just trace the goto statements whereas when you write strutcured code you have to follow the loops etc."

spaghetti code is nearly impossible to follow, you would have to use the debugger to figure out what you wrote the previous day in a bad case.

which is easier:

for(int i=0; i<=10; i++){
//do something
}

or

int i;
begin:
// do something
i++;
if(i<=10) goto begin;

and more inportantly, which is easier to understand.


code that uses goto would also be slower (unless the bus speed and memory speed is the same as your processor speed). I assume that most compilers would use a register (like cx) to store the loop count, goto (at least in the example above) would have to access memory many more times.
quote:
2) Spaghetti code is easier to read b/c you can just trace the goto statements whereas when you write strutcured code you have to follow the loops etc.



Understanding what some code does isn't just a matter of tracing the path of execution. So what if you can easily see that the program jumps up a few lines at some point? What does that tell you about the loop? Nothing. You'd have to scan through all the code in between to find the conditions for breaking the loop.

With for or while loops, you always know where the conditions are. If you see a for loop you know exactly what's being changed and how, and when it'll stop.

Edited by - frankd on April 21, 2001 1:00:32 PM

This topic is closed to new replies.

Advertisement