Questions tagged [goto]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
108 votes
11 answers
21k views

What kind of bugs do "goto" statements lead to? Are there any historically significant examples?

I understand that save for breaking out of loops nested in loops; the goto statement is evaded and reviled as a bug prone style of programming, to never be used. Alt Text: "Neal Stephenson thinks it'...
Anon's user avatar
  • 3,603
68 votes
12 answers
35k views

Is this a decent use-case for goto in C?

I really hesitate to ask this, because I don't want to "solicit debate, arguments, polling, or extended discussion" but I'm new to C and want to gain more insight into common patterns used in the ...
Robz's user avatar
  • 1,633
36 votes
14 answers
30k views

Is using goto ever worthwhile?

goto is almost universally discouraged. Is using this statement ever worthwhile?
Casebash's user avatar
  • 7,662
31 votes
10 answers
18k views

Do we still have a case against the goto statement? [duplicate]

Possible Duplicate: Is it ever worthwhile using goto? In a recent article, Andrew Koenig writes: When asked why goto statements are harmful, most programmers will say something like "because ...
fredoverflow's user avatar
  • 6,874
13 votes
7 answers
11k views

Best practice to "continue" from inside a nested loop?

Here is a simplified sample. Basically, it does checks on a string from a string list. If the check passes, it will remove that string (filterStringOut(i);), and it is no longer ...
Anon's user avatar
  • 3,603