|
There is not an assembler program without GOTO.
Fortran without GOTO is too hard.
But in the real programming - GOTO is absolute unusable in all situations. Last 25 years, I did not write GOTO( expect assembler) and removed each one from reused code.
|
|
|
|
|
Twenty years ago i was 10, and learning to program in QBASIC. That was the last time I used GOTO.
|
|
|
|
|
I grew up with gotos, and saw their abuse first hand. Then some luminary someplace realized they were being abused, so decreed them to be evil. Now I keep them hidden away in my basement, away from prying eyes. I don't abuse my gotos like other programmers did, and see that they can still be useful, but I'm too scared of what the other programmers would say to let them out to frolic once in a while. Poor abused little gotos ;(
We can program with only 1's, but if all you've got are zeros, you've got nothing.
|
|
|
|
|
As a matter of fact, I have to MainTainTheInsane Ball of string of GoTo's in legacy applications that were written decades ago by someone who is long gone. I see it all over and really had a fit when I had to code around them. But since I have been learning COBOL of all flavors, I can now see that it was all they had back then; think of Sequential programing real hard with no bells and whistles like the modern languages have now. After figuring out what one of these old legacy apps does, I have to admire the person/s who had written them; they had to be a lot more creative with so little to work with than what programmers have today to work with. Actually, I have seen some really cool logic using the GoTo; and again, some really insane WTF! stuff. Back in the days, yeah, it was necessary. Todays programming, NOT
|
|
|
|
|
I've used goto in C for coroutines in IP or serial protocols, mainly for manually crafting versions of the Protothread / Duffing machine trick. It's also handy in trampoline functions for tail recursion.
It can be clearer and more consise than the alternatives.
modified 4-Mar-13 12:54pm.
|
|
|
|
|
I can think of only one use for a Goto - tail recursion. A gosub or call immediately followed by a return can be replace by a Goto, saving stack space and the time needed to create/undo a stack frame.
|
|
|
|