4 ms·
"Please don't fall into the trap of believing that I am terribly dogmatical about [the goto statement]. I have the uncomfortable feeling that others are making
by andolanra 7y ago
"Please don't fall into the trap of believing that I am terribly dogmatical about [the goto statement]. I have the uncomfortable feeling that others are making a religion out of it, as if the conceptual problems of programming could be solved by a single trick, by a simple form of coding discipline!"
—E. W. Dijkstra
- gumby 7y agoIndeed when he wrote that paper code looked quite different (multiple entry and exit points) and was mostly in assembler. What is a break;, continue; or return; statement but a goto?
- whateveracct 7y agoThey're just gotos an authority told us we can use
- monocasa 7y agoThey're gotos with restricted semantics, just like every nearly every other control flow mechanism. The restricted semantics makes it interesting without going into "an authority said they're ok". Abstracting so that you can more easily reason about (and you can explain to others so that they can more easily reason about) the full state space something can operate in is a not terrible definition for engineering in general.
- deleted 7y ago[deleted]
- whateveracct 7y agoBut the fact that those are the industry's blessed goto abstractions is as much a fiat artifact of authority as anything else.
- monocasa 7y agoLol, they're common patterns even in asm. I've programmed plenty of systems that don't even really support C that well, and you end up doing the same things. What better abstractions do you have?
- gumby 7y agoDamn these fiat controls structures! We need to move to the gold(1) standard! (Actually your point is good I simply couldn’t resist the pun)
- Brian_K_White 7y agoYou think "return" is just an arbitrarily blessed altenative way to spell "goto"? Please don't ever code on a project I care about.
- whateveracct 7y ago> Please don't ever code on a project I care about. What a visceral reaction to me saying that `return` isn't an inherent truth but rather an artifact of network effects! I never would've expect this level of vitriol for this comment.
- Brian_K_White 7y agoThey are gotos with pre-loaded predictable destinations instead of random destinations. This does indeed make them entirely different in character. This is like saying "What is any function call but a goto?" Not a useful question.