Name: Anonymous 2011-05-27 14:38
why is it so bad?
10 GOTO 10
#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;
}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.
NotALabel:
for(int x = 0; x < 100; x++) {
for(int y = 0; y < 100; y++) {
if(y == 55) break NotALabel;
}
}