3 ms·
A large part of the debate that followed the publication of "GOTO Considered Harmful", and which smolders to this day, concerned whether there are any corner ca
by mannykannot 11y ago
A large part of the debate that followed the publication of "GOTO Considered Harmful", and which smolders to this day, concerned whether there are any corner cases where gotos are the better choice. This rather pedantic issue is largely beside Dijkstra's main point, which was that it is infeasible to analyze programs for correctness unless they use simple, nested, control and flow structures. Of course, Dijkstra himself bears some of the responsibility for this diversion, through his choice of a click-baity title. He was probably right in this choice however, as the paper got enough attention to have a significant and lasting influence (though we are not doing analytical verification to anywhere near the extent he demanded.)
- 0x07c0 11y agoThey are not corner cases, it rely depend on what domain you work in. Currently working on "tooling" for HPC application, and use goto all the time. Any form of system programming in c will probably have lots of goto's. Error handling being the most usual. Also some algos express them self best using goto's. And of course asm, try writing anything in asm without jumps :-)
- mannykannot 11y agoI think I am on safe ground in saying that Dijkstra was well aware of the use of jumps in asm, but that is beside the point he was making in the body of the paper - as opposed to the point, taken from the title of the paper, that most of the argument has been about.
- 0x07c0 11y agoWell the part about asm was obviously a joke, control structures are nice to have. My point was that in many domains goto's are useful, both for solving problems, getting performance and for code clarity.