Edit: I just mean the tone the study writer takes is ridiculous. It is good to know that goto is used thoughtfully.
Edit: I just mean the tone the study writer takes is ridiculous. It is good to know that goto is used thoughtfully.
To replicate the goto that Dijkstra was complaining about in C, you would have to put the entire program in the main function, use no for loops or switch statements, and use if statements with bodies that only jump to labels and contain nothing else in their bodies. Nobody programs like that for their entire program. Dijkstra won.
(On occasion, people structure a function as a state machine rather than a stack, but generally only in special circumstances. C-style error handling is also simply using the language tools to implement exceptions, not unstructured programming.)
For extra verisimilitude, you'd have to re-invent the 'arithmetic if' statement. Since most programmers working now have no idea what that is, I'll explain:
IF (A-B) 10,15,45
That is an 'arithmetic if' statement; it means "If A-B < 0, goto line 10. If A-B == 0, goto line 15. If A-B > 0, goto line 45."That's it. You can't change which number it compares the expression to. You can't change the fact it's just a conditional goto with a somewhat more involved than usual conditional. (You can work around these things, but it involves doing more by hand, which languages should ameliorate.)
That was introduced to the high-level language world in an ancient version of FORTRAN, apparently copied by some BASIC dialects which didn't know any better, and then totally ignored for decades, a trend I heartily endorse.
That's exactly how I programmed when I was learning BASIC in elementary school. :-) I still remember my friend trying in vain to explain what a FOR loop did, and I remember when it finally occurred to me why GOSUB/RETURN wasn't pointless. It really makes me appreciate structured programming!
So this is pretty much the control flow equivalent of someone complaining about memory errors in languages like C (dangling pointers/memory leaks), and then much later some academics look through some code written in a managed GC'ed language like Java or C# and decide that the original complainer really didn't have anything to worry about.