It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
avatar
adambiser: Yes, because they've added constructs to the language in order to work around the fact that they don't have GOTO. Java added loop labels as a way to break out of outer loops from an inner loop (about the only "valid" reason for a goto). I don't think C# or C++ do, but then they have goto which you must either use or restructure your code in ways that might not be as easy-to-read.

That said, GOTO should be completely avoided.
Well, yeah, I mean part of the reason I hate GOTO statements with such a passion is the way that they were implemented in BASIC. If you needed to add code somewhere in the middle of the program you had to worry about having every GOTO that referenced a line after that was fixed. I assume that there were IDEs that dealt with that, but I didn't have access to them.
avatar
hedwards: Well, yeah, I mean part of the reason I hate GOTO statements with such a passion is the way that they were implemented in BASIC. If you needed to add code somewhere in the middle of the program you had to worry about having every GOTO that referenced a line after that was fixed. I assume that there were IDEs that dealt with that, but I didn't have access to them.
yeah auto line renumbering existed in many IDE's (they even changed the goto's to the correct numbers)
avatar
adambiser: That said, GOTO should be completely avoided.
avatar
wodmarach: at last count the Linux kernal had over 90k goto's do not generalise. GOTO it's very handy in baremetal coding.
Hmm, that's an interesting question, I wonder how many were used in the FreeBSD kernel. I guess I'll have to whip up a quick script to count them. Although given the number of files that could take a bit.
avatar
wodmarach: at last count the Linux kernal had over 90k goto's do not generalise. GOTO it's very handy in baremetal coding.
avatar
hedwards: Hmm, that's an interesting question, I wonder how many were used in the FreeBSD kernel. I guess I'll have to whip up a quick script to count them. Although given the number of files that could take a bit.
Yeah basicly the lower level your coding the more GOTO's have a reason and a use.
avatar
wodmarach: yeah auto line renumbering existed in many IDE's (they even changed the goto's to the correct numbers)
I tend to assume so, but that was prior to the internet so chances are good that one could learn to code BASIC without knowing about those options.
avatar
wodmarach: Yeah basicly the lower level your coding the more GOTO's have a reason and a use.
Well yeah, I know when you start working on assembly you end up having to do that sort of thing all the time as I don't believe that there are other options. Or at least in the few times I've looked at assembly I haven't seen folks with a different method.
Post edited January 19, 2012 by hedwards
avatar
hedwards: Well yeah, I know when you start working on assembly you end up having to do that sort of thing all the time as I don't believe that there are other options. Or at least in the few times I've looked at assembly I haven't seen folks with a different method.
JMP is one of the most used commands in assembler JMP is a goto. Infact one of the shortest pieces of code to crash a computer is

JMP $

$ points to the start of the command so it's a jump back to it's self... helllloooo infinite loop
Post edited January 19, 2012 by wodmarach
avatar
hedwards: Well yeah, I know when you start working on assembly you end up having to do that sort of thing all the time as I don't believe that there are other options. Or at least in the few times I've looked at assembly I haven't seen folks with a different method.
avatar
wodmarach: JMP is one of the most used commands in assembler JMP is a goto
I know that, I wasn't thinking of that JMP for some reason I was thinking about the jump that Java has.
avatar
adambiser: That said, GOTO should be completely avoided.
avatar
wodmarach: at last count the Linux kernal had over 90k goto's do not generalise. GOTO it's very handy in baremetal coding.
I was speaking about high-level languages like Java, C#, C++, etc. Of course they are essential in the low-level languages. JMP and its variants are necessary in assembly.

EDIT: And yes they will appear when you compile high-level languages, but that's not something at which the coder has to look.
Post edited January 19, 2012 by adambiser