goto is merely a tool that got a bad rap simply because it has its roots in basic assembler, back before structured programming was a thing. I agree with you regarding its use, but I'm still surprised by just how many seemingly educated programmers jump onto the "never use goto" cargo cult because of a paper title that they misattribute to Djikstra.
Ironically, from the code I've seen, I don't think I've ever seen anyone actually misuse goto, probably because the people who use it actually know what they're doing. That's just anecdotal on my part, but still.
Ironically, from the code I've seen,
I don't think I've
ever seen anyone actually misuse goto,
probably because the people who use it
actually know what they're doing.
That's just anecdotal on my part, but still.
Worse case, imagine a GOTO at the end of each line of code.
There was no lexical scoping in BASIC [1] (and all variables were global but that's another topic) so one could literally GOTO any point in the program.
[1] I'm talking about the BASIC one found on most 80s home computers at the time.
> Ironically, from the code I've seen, I don't think I've ever seen anyone actually misuse goto, probably because the people who use it actually know what they're doing. That's just anecdotal on my part, but still.
I've misused goto at least once in the brave new world(tm) of structured programming. That said, once the cleaner way to do things occurred to me, I refactored it away immediately.
Ironically, from the code I've seen, I don't think I've ever seen anyone actually misuse goto, probably because the people who use it actually know what they're doing. That's just anecdotal on my part, but still.