3 ms·
Someone made a similar claim in HN recently. I reviewed Dijkstra's paper and it doesn't bear out the claim. The C goto falls squarely under the scope of the pap
by kazinator 3y ago
Someone made a similar claim in HN recently. I reviewed Dijkstra's paper and it doesn't bear out the claim. The C goto falls squarely under the scope of the paper.
Dijkstra's paper is not strictly focused on a global, machine-language goto that can branch anywhere in the address space.
In fact, Dikjstra mention that he would also like to banish statement like while B repeat A and repeat B until A, because we have recursion, which makes them unnecessary. He lets them slide only for reasons of "realism" and because such loops are analyzable with inductive techniques.
- JonChesterfield 3y agoThere is imprecision in my wording. The paper was about removing goto from high level programming languages. The context in which people were starting to view goto with suspicion was that of ~1968, at which point I believe the baseline assumption was that goto was a branch to anywhere as that's what assembly gives you. However it was before my time and I'm inferring from partial information. I think the distinction between goto as rendered in C and goto as rendered in machine code is significant. It's the same argument in favour of structured programming in both cases. The gap between structured programming and local goto within a function is smaller than in the assembly case.
- kazinator 3y agoAlgol 60 already had a go to statement, restricted to jumping to local labels, similar to the one in C. It is only my speculation, but it seems very likely that Dijkstra had the Algol 60 and Algol 68 go to statements in mind. As in, an example high level language from which to banish the go to statement would have been whatever successor is planned for Algol 68.