Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

goto

Name: Anonymous 2011-05-27 14:38

why is it so bad?

Name: Anonymous 2011-05-27 15:03

10 GOTO 10

Name: Anonymous 2011-05-27 15:10

It isn't bad if you use it once or twice, but if you use it too much, it tends to turn your code into mangled shit.

Name: Anonymous 2011-05-27 15:13

>>3
You're wrong!
#include <stdio.h>
#define _(w) printf(w);
int main (int argc, char** argv) {
    int ec=-1,oc=-1,vc=-1,tc=-1,cc=-1,sc=-1,uc=-1;
    start: goto lh;
    ly:_("y") goto lo; le:_("e") if(++ec==0) goto cs; if(ec==1) goto lv; if(ec==2) goto lr; if(ec==3) goto ld; if(ec==4) goto cs; goto lv;
    la:_("a") goto lv; lo:_("o") if(++oc==0) goto lu; if(oc==1) goto lt; if(oc==2) goto cs; goto cs; lb:_("b") goto le; li:_("i") goto ll;
    ll:_("l") goto qm; lv:_("v") if(++vc==0) goto le; if(vc==1) goto le; goto li; qm:_("?") goto en; ls:_("s") if(++sc==0) goto le; goto lt;
    lt:_("t") if(++tc==0) goto lo; if(tc==1) goto cs; goto lo; lj:_("j") goto lu; lr:_("r") goto cs; ld:_("d") goto cs; lg:_("g") goto lo;
    cs:_(" ") if(++cc==0) goto ly; if(cc==1) goto le; if(cc==2) goto lu; if(cc==3) goto lg; if(cc==4) goto lj; if(cc==5) goto lt; if(cc==6) goto lb; goto le;
    lu:_("u") if(++uc==0) goto cs; if(uc==1) goto ls; goto ls; lh:_("h") goto la; en:_("\n")
    return 0;
}

see? perfectly clear

Name: Anonymous 2011-05-27 15:41

function calls are gotoes.

Name: Anonymous 2011-05-27 16:47

>>4
omg i ran ur code and it gave me a VIRUS@!!!

Name: Anonymous 2011-05-27 16:56

>>6
omg your compiler must be soooo shitty to compile this code into VIRUS@!!!

Name: Anonymous 2011-05-27 17:05

>>5
Hey dude your ass is talking of its own volition again. Might want to get that checked.

Name: Anonymous 2011-05-27 17:08

jmps are function calls.

Name: Anonymous 2011-05-27 17:26

>>9
NO IM PRETTY SURE THAT'S MOV

Name: Anonymous 2011-05-27 18:18

>>9
Yeah, no.

Name: Anonymous 2011-05-27 18:50

goto is used a shit ton in OS code.

Name: Anonymous 2011-05-27 19:08

Structured programming tried to eliminate a generic goto not to deal with pathological cases like >>4, but to try and minimize the confusion caused by complex programs that have hints of the problems showcased in >>4. The Concerned Persons tried to figure out what patterns of goto were being used the most, and strongly advised people to avoid more primitive control structures in favour of their new inventions so that the programs would be better at self-documenting. This is the same reason we use informative variable names everywhere else.

Unfortunately, several trillion lines of Java later, OOPers, the descendents of structured imperative programmers, goto is considered the spawn of Satan, and Dijkstra and Wirth have ultimately been proven wrong: forcing people to write well-formatted, legible code does barely anything for its readability, and poorly-trained morons will always discover bigger and better anti-patterns.

Name: Anonymous 2011-05-27 21:15

>>4
That was cute and I could figure out what it did right away, because you used meaningful labels. (The string constants were another big clue...)

Name: Anonymous 2011-05-27 21:43

goto is important for exiting deeply nested loops

Name: Anonymous 2011-05-27 22:15

goto considered good

Name: Anonymous 2011-05-27 22:56

>>16
good considered bad!

Name: Anonymous 2011-05-27 22:59

>>15
Java has a solution to this.


NotALabel:
for(int x = 0; x < 100; x++) {
  for(int y = 0; y < 100; y++) {
    if(y == 55) break NotALabel;
  }
}


See? You put the label at the start and it's totally different!

Guys?

...guys?

Name: Anonymous 2011-05-28 0:30

>>19 GOTO >>19

Name: Anonymous 2011-05-28 1:46

>>20 COMEFROM >>19

Name: Anonymous 2011-05-28 13:12

aqwsderftgzhjukolä+#
74+ GOTO Anus

Name: Anonymous 2011-05-28 14:33

>>14
k, next time i just smash keyboard with my head for labels / variable names. How's that sound?
>>18
break with label is considered a Java goto replacement, so no, it's not a solution

Name: Anonymous 2011-05-28 18:11

The Jews are after me

Name: Anonymous 2011-05-30 3:38

goto is bad because my fucking compiler doesn't know how to compile it correctly
jmp, however, is master race
or would be if asm would always assemble correctly
which is why I use machine opcodes directly
fucking compilers and assemblers, why are they so retarded?

Name: Anonymous 2011-05-30 3:52

>>24
Oh, it's the assembler that's stupid, not you, right?

Name: Anonymous 2011-05-30 6:49

>>25
If it's a simple but good idea that the assembler can not express, then possibly.

Name: Anonymous 2011-05-30 7:41

>>24
which is why I use machine opcodes directly
No, you don't. You daydream about using machine opcodes directly to create awesome programs and gain worldwide fame as one of the trve oldskool hackers, then Trinity calls you and begs to allow her to suck your dick. But in reality you do not use machine opcodes directly, as a matter of fact. In reality you are a useless daydreaming piece of human waste.

Name: Anonymous 2011-05-30 7:49

>>27 is butthurt because he can't use machine opcodes directly

Name: Anonymous 2011-05-30 8:10

>>24,28
I used machine opcodes directly when I was 12, strictly because I didn't have a portable assembler that I could bring to school with me.  What I had was a folder full of opcode maps and symbol tables.  Outside of that and crafting remote code injections, it's pretty much pointless.

Name: Anonymous 2011-05-30 8:20

>>29
I have 65536 years programming experience writing HUGE Programs that you couldnt even comprehend. I wrote an ANSI Java compiler when I was 12 years old using perforated cards.

Name: Anonymous 2011-05-30 8:26

I wrote an ANSI Java compiler when I was 12 years old using perforated cards.
So you did something retarded using antiquated methods?  That's par for the course for normal programmers.
On the other hand, if this was before 1996, we must tar, feather, and lynch you for creating Java.  Sorry about this but that's how it goes.

Name: Anonymous 2011-05-30 9:01

>>31
You sound like you're trying to be funny in response, but actually you're Assparagus prevents you from saying anything that isn't totally tumbleweed-inducingly earnest.

Name: Anonymous 2011-05-30 9:12

>>32
No, no, yours was the intended interpretation.

Name: Anonymous 2011-05-30 9:27

>>33
What about his indention?

Don't change these.
Name: Email:
Entire Thread Thread List