4 ms·
The author would have done much better if, rather than poking sticks at those who wish to forbid gotos, and posting vague and generic quotes about memes and car
by numeromancer 12y ago
The author would have done much better if, rather than poking sticks at those who wish to forbid gotos, and posting vague and generic quotes about memes and cargo-cults, they had provided several examples of code wherein the use of gotos was a decided improvement, in terms of speed and clarity, over the best that could be done without it. Anyone who has read code that has been twisted out of shape, or entagled with unecessary "done" flags and the like, and who can be improved with such remonstrations, will recognize the virtue in this point of view.
- Gracana 12y agoIn C, goto is useful for jumping from various parts of a function to a single section of resource-cleanup-and-return code. I might also use goto as a way to break out of a set of nested loops. I think those are both generally accepted idioms among C programmers.
- deleted 12y ago[deleted]
- shabbyrobe 12y ago> Only because C doesn't have proper control structures for doing otherwise. Yes it does: it has goto, which works absolutely fine for both purposes.
- deleted 12y ago[deleted]
- Gracana 12y agoI did not cite C as an example of ideal code style or convention.
- deleted 12y ago[deleted]
- coldtea 12y ago>The author would have done much better if, rather than poking sticks at those who wish to forbid gotos, and posting vague and generic quotes about memes and cargo-cults, they had provided several examples of code wherein the use of gotos was a decided improvement, in terms of speed and clarity, over the best that could be done without it. He would have only done better by doing that if his goal was to merely educate people that goto can be good too. Which is very far from being his goal.
- KedarMhaswade 12y agoWould you think http://bit.ly/recurse-iterate http://bit.ly/recurse-iterate does an okay job of working toward that goal?