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

Pages: 1-

What's wrong with GOTO?

Name: Anonymous 2008-04-25 21:05

Saying that GOTO is wrong is like saying that pointers are wrong.

If you didn't know, your CPU doesn't call functions. It "calls" addresses or jumps, like, GOTO 10, which may be written in x86 assembly as JMP 10. You may have noticed that it's a direct translation, so using goto in languages like C gives the programmer even more flexibility for optimizations - more than using lots of functions and macro crap.

Name: Bucket !!PhiVV3U2X7TT1Xm 2008-04-25 21:07

You dislike the way you're saying that pointers are wrong.

Name: Anonymous 2008-04-25 21:07

That's pretty much it. It's just that when programmers only use goto in an HLL when the same code can be written with the if/while/for constructs that there's a problem.

Name: Anonymous 2008-04-25 21:08

I use GOTO to escape out of deeply nested loops.

Name: Anonymous 2008-04-25 21:14

If you need goto then your language doesn't have adequate control structures.

Pointer arithmetic should be avoided.

Low-level optimizations should be done by the compiler.

Name: Anonymous 2008-04-25 21:20

>>4
It's a shame C's break doesn't accept an argument.

Name: Anonymous 2008-04-25 22:09

>>5
Using pointer arithmetic is not the same as pointers, however. Pointers are full of epic win.

Name: Anonymous 2008-04-25 22:22

>>1
And that's why I miss BASIC.

Name: Anonymous 2008-04-25 23:03

>>1
Shut your nigger ass up.  Function calls translate to the CALL instruction, you shitfuck.  Even RISC architectures that make you "build your own JSR" have something like the MIPS jal which essentially pushes the current instruction pointer onto a register.  Quite unlike a goto or any unconditional jump.  Fuck off.

Name: Anonymous 2008-04-25 23:51

goto """__CONSIDERED__""" harmful

Name: Anonymous 2008-04-26 0:00

If you can optimize your code better than gcc I'll eat my hat.

Name: Anonymous 2008-04-26 0:11

>>11
I've always read that gcc's optimizer (specifically, it's C optimizer) is subpar compared to, say, Intel's or ARM's optimizers. The benefit to using gcc has always been explained to me as "it'll build on anything", that gcc while somewhat less efficient than single-architecture compilers in that it has the widest selection of target platforms.

Name: Anonymous 2008-04-26 0:26

>>12
That's right. There is a greater code investment going into getting GNU C Compiler running on the different platforms and maintaining the program for those platforms rather than tweaks to get better machine code.

Name: Anonymous 2008-04-26 1:30

>>1
It is a meme.  Otherwise, nothing.
Linux kernel .21 has 44393 goto's.

Name: Anonymous 2008-04-26 3:16

Saying that GOTO is wrong is like saying that pointers are wrong.
If you didn't know, your CPU doesn't call functions. It "calls" addresses or jumps, like, GOTO 10, which may be written in x86 assembly as JMP 10. You may have noticed that it's a direct translation, so using goto in languages like C gives the programmer even more flexibility for optimizations - more than using lots of functions and macro crap.

There isn't much wrong with GOTO. It's morons like you that don't get it and misuse it to a disgusting level.
In case you didn't know, your CPU doesn't use GOTO 10, it uses bytecode. So let's ditch assembly and use bytecode. In case you didn't know, your CPU actually does the work you could do by hand, let's ditch CPU's and use our hands.
Damn, you fucking faggot, learn about abstraction.
There's a reason there are high level interfaces out there.

Name: Anonymous 2008-04-26 5:26

>>15
And there are valid reasons to go down a layer or two of abstraction when it proves to be scientific and ultimately productive.

Name: Anonymous 2008-04-26 5:29

>>16
And there are valid reasons to go down a layer or two of abstraction when it proves to be scientific and ultimately productive.
When's that and why is it relevant to OPs stupidity?

Name: Anonymous 2008-04-26 7:15

nothing in standard c is bad..

Name: Anonymous 2008-04-26 13:30


10 FOR I=1 TO 20
20 IF I=7 THEN GOTO 40
30 NEXT I
40 PRINT"JUMP"
50 END


AM I DOIN IT RITE?

Name: Anonymous 2008-04-26 13:33

>>19
No.  First of all, you are using line numbers, that's just wrong.  Secondly, don't use GOTO, because it's evil.

PRINT "JUMP"

Done.

Name: Anonymous 2008-04-26 13:38


10 PRINT "hax my anus"
20 GOTO 10

Name: Anonymous 2008-04-26 13:43

>>15
There's a reason there are high level interfaces out there.

And there's a reason we still code in C and ruby on rails is slow as fuck

Name: Anonymous 2008-04-26 18:03

>>2

There is, but they're not the reasons you do.

Name: Anonymous 2008-04-26 19:10

>>23
I used to reply Bucket like you do, but then realised it was useless

Name: Anonymous 2008-04-26 21:03

>>24 Now you have one problem

Name: Anonymous 2009-02-25 7:45


Break this volatile union   try catch friend   goto class while   explicit do continue.

Name: Anonymous 2009-07-21 2:50

but  I... that because  idea! liked just took die him into die a his as  anyway? for you (well, whole options. options. Those languages          call of in like call hand  that a

Name: Anonymous 2010-11-25 7:21

Name: Anonymous 2011-02-04 17:27

Name: Sgt.Kabukiman䖉 2012-05-22 23:26

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

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