Name: Anonymous 2012-09-17 19:14
I'm using goto outside assembly and there's nothing you can do about it, meanwhile your jewish teachers gave your looping toys and forbid faster code for you.
goto is for idiots who can't figure out how to self-modifying code.
goto /g/, ``please''!
goto my anus
goto? It's usually some abbreviation of branch or jump. I've seen b, br, bra, j, jmp, jump, and even mov to the program counter but I've never seen a goto mnemonic. I'd be interested to see what architecture that is.
goto >>8
goto, call and sleep the rest of its three dozen mnemonics are things like btfss, iorwf and incfsz.
int foo(int x)
{
int status = 0;
(void) bar(x);
if (0 != baz(x)) {
status = -1;
goto out1;
}
(void) qux(x);
out1:
unbar(x);
return status;
}unbar if baz fails.
int foo(int x)
{
int status = 0;
(void) bar(x);
if (baz(x) == 0)
{
(void) qux(x);
}
else
{
status = -1;
}
unbar(x);
return status;
}
qux represents a non-trivial amount of code - do you really want to nest all of it inside the else? Doing that is arguably less readable than just using goto.elses also don't deal well with cases where you need to do a bunch of things in order and then back them all out if something goes wrong, e.g.
int foo(int x)
{
int status = 0;
(void) bar(x);
if (0 != baz(x)) {
status = -1;
goto out1;
}
if (0 != qux(x)) {
status = -1;
goto out2;
}
(void) xyzzy(x);
out2:
unbaz(x);
out1:
unbar(x);
return status;
}
int foo(int x)
{
int status = 0;
(void) bar(x);
if (baz(x) == 0) {
if (qux(x) == 0) {
(void) xyzzy(x);
} else {
status = -1;
}
(void) unbaz(x);
} else {
status = -1;
}
(void) unbar(x);
return status;
}
goto?
100.times do |i|
100.times do |j|
break "``please''!"
end and break
end
try ... catch also works for this.
> GOTO HELL
? Undefined line