-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GOTO considered harmful #718
Conversation
Related #689 |
GOTO considered harmful
Huh. :-) |
(Put another way, |
I don't see any reason to use a |
But that's exactly the case. :-) The negative attention that http://stackoverflow.com/questions/46586/goto-still-considered-harmful See quotes of Dijkstra himself, Knuth and, further down, Torvalds. Most pointedly, the title "GOTO considered harmful" was added by the editor, replacing Knuth's much more conservative "A case against the goto statement". The way I think about it is, if it makes the code clearer, then I use it, otherwise I don't. In this case, I feel that it makes explicit the situation where a caller has given
This makes a statement about what we do if, for instance, someone adds enumerated value The updated form handles unrecognized values in the same way, but the behaviour is implicit. There's nothing that calls the reader's attention to the fact that there might be unrecognized values in Finally, while it is true that To be clear, I've put way more time and effort into writing this up than I have consternation about the change. I'm not at all upset by this follow-up pull request. I do disagree with the principle behind it, but ultimately the code still does the same thing, and the codebase is yours to style as you see fit. i'll not pass up an opportunity for some friendly information-passing on the subject, though. :-) |
GOTO considered harmful