Hacker News new | past | comments | ask | show | jobs | submit login

"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




Indeed 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?


They're just gotos an authority told us we can use


They'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.


But the fact that those are the industry's blessed goto abstractions is as much a fiat artifact of authority as anything else.


Damn 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)


Lol, 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?


[flagged]


> 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.


They 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.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: