by jacques_chester · 13y ago · 0 comments
This is a period of time when the concept of higher level languages with specialist if-then, loops and return statements were still relatively new.
Most programmers in the world had cut their teeth on assembly language. In that model the natural way to think of programs is as a sequential series of addresses in memory that contain instructions.
Since all control structures are merely jumps to a new address, so why were all those grumpy ivory tower idiots so keen on abolishing goto?
Probably the biggest blow to the pro-goto camp in those days was the discovery of the "Structured Program Theorem" in 1966. It was proved that any computable algorithm can expressed in any higher level language that has sequencing of instructions, ability to select an execution path and iteration. The ability to jump is not required. For the times it was an critical discovery because it meant higher level language designers could proceed with the confidence that any HLL they designed with those three properties would be usable for any algorithm in theory.
Finally, Dijkstra (and the other European greats like Hoare and Wirth) had in mind a particular vision of what programming ought to be. He didn't see it so much as an engineering activity. He wanted to treat programs as mathematical objects. Controlling the scope of languages can make this more or less tractable. So for example the "one return from a function" rule goes back to this vision, but has since gone on to live a care-free life of its own.
[1] http://www.u.arizona.edu/~rubinson/copyright_violations/Go_T...
I believe those are reason enough to avoid doing those particular things, even if the global jumping of assembly of course is even worse.
Oh-oh spaghetti-oh!
Not that you should waste your time programming in a GOTO dependant language, but it becomes pretty obvious after a couple of days why GOTO sucks.
The opening article is pretty vacuous imo. That's not really a legitimate use, it's just that C++ doesn't support finally.
The examples given are ones of considered and deliberate use of GOTO by choice in a systems programming context.
John Regehr knows his stuff and generally expects the same of his readers. Given his background as a harsh but fair critic of the ragged edges of the C Language standard the part of interest here is that he lets these examples go under the umbrella of "fine by me"
That you found the article vacuous in your opinion is no surprise, at a guess I'd ascribe that to general ignorance on your part as born out by the comment you made. Never mind, you can rectify that with a bit of applied effort.
Perhaps you could write an article about the usefulness of Option Explicit in vbscript to really underline the take away here.
I'd love to see you defend the claim that [goto] has a number of legitimate uses in well-structured code including an idiom seen in systems code
Defend that odd statement and you might have a claim on the superiority you're fatuously exuding.
Personally I haven't seen a goto in live code apart from C for about 8 years. But perhaps I'm too durr hurr stupid to notice in the hundreds of different programs I've read.
Actually that's not what this article is about at all, it's a small part of a much larger arc about C, C semantics, and LLVM. As I pointed out, you're ignorant of this.
> Perhaps you could write an article about the usefulness of Option Explicit in vbscript to really underline the take away here.
Irrelevant and unconnected.
> I'd love to see you defend the claim that [goto] has a number of legitimate uses in well-structured code including an idiom seen in systems code
No need, it's an argument that's been covered already, probably before you were born. As others have pointed out even Dijkstra conceded it's (appropriate) usefulness, he simply wished to promote structured code and the (at the time) endemic bad use of GOTO.
> a claim on the superiority you're fatuously exuding.
Just experience, and seemingly more than yours.
> But perhaps I'm too durr hurr stupid to notice in the hundreds of different programs I've read.
While I originally inferred ignorance and not stupidity on your part I concede that you are making a strong case for the latter.