Click here to Skip to main content
16,012,107 members

Survey Results

The goto statement.   [Edit]

Survey period: 8 Jan 2001 to 14 Jan 2001

We want to finally put to rest the question of whether the goto statement is a Good Thing or a Bad Thing.

OptionVotes% 
It's a great thing. Can't live without it.111.60
It's handy if used correctly16724.31
It's just a piece of syntax - niether good nor bad.8612.52
I don't like it, but can see why it may be useful sometimes.25136.54
It's a Very Bad Thing17225.04



 
GeneralOpposite of GOTO Pin
13-Feb-01 19:03
suss13-Feb-01 19:03 
GeneralA 'nice' place to goto. Pin
Alvaro Mendez12-Jan-01 12:29
Alvaro Mendez12-Jan-01 12:29 
GeneralRe: Never use Pin
Jim A. Johnson13-Jan-01 15:21
Jim A. Johnson13-Jan-01 15:21 
GeneralNever use "Goto" in the UI Pin
Jim A. Johnson12-Jan-01 8:54
Jim A. Johnson12-Jan-01 8:54 
GeneralNobody should use 'goto' Pin
MrLonely12-Jan-01 5:06
MrLonely12-Jan-01 5:06 
GeneralRe: Nobody should use 'goto' Pin
Matthew Adams12-Jan-01 6:21
professionalMatthew Adams12-Jan-01 6:21 
GeneralRe: Nobody should use 'goto' Pin
Jesse Collins12-Jan-01 7:37
Jesse Collins12-Jan-01 7:37 
GeneralRe: Nobody should use 'goto' Pin
12-Jan-01 9:49
suss12-Jan-01 9:49 
GeneralRe: Nobody should use 'goto' Pin
12-Jan-01 9:56
suss12-Jan-01 9:56 
GeneralRe: Nobody should use 'goto' Pin
Matthew Adams14-Jan-01 23:53
professionalMatthew Adams14-Jan-01 23:53 
GeneralRe: Nobody should use 'goto' Pin
MrLonely13-Jan-01 12:38
MrLonely13-Jan-01 12:38 
GeneralRe: Nobody should use 'goto' Pin
Matthew Adams14-Jan-01 23:59
professionalMatthew Adams14-Jan-01 23:59 
GeneralRe: Nobody should use 'goto' Pin
12-Jan-01 9:43
suss12-Jan-01 9:43 
GeneralRe: Nobody should use 'goto' Pin
Wolfram Steinke14-Jan-01 9:41
Wolfram Steinke14-Jan-01 9:41 
GeneralGoto Empire States please--> :) Pin
11-Jan-01 11:08
suss11-Jan-01 11:08 
Generalvalid use of goto Pin
11-Jan-01 4:25
suss11-Jan-01 4:25 
GeneralRe: valid use of goto Pin
Jesse Collins11-Jan-01 13:40
Jesse Collins11-Jan-01 13:40 
A textbook motive for exception handling if i've ever seen it.
In some cases like this (not this one, really) break statements may be helpful.
The problem is, you can't break out of arbitrary {} blocks, so with your example, you'd have to...
.
.
.
do
{
eRc = func1();
if (eRc!=__NOERR) break;

eRc = func2();
if (eRc!=__NOERR) break;
}
while(0);

docleanup();
return eRc;
}

but the odd do..while may be too ugly to justify this method. Perhaps..

#define START_BREAKABLE do
#define END_BREAKABLE while(0);

but that might be just as bad. My point is that in many similar situations you can use breaks instead, and while still not entirely elegant, to me they are easier to follow and visualize than a goto.
GeneralRe: valid use of goto Pin
12-Jan-01 17:33
suss12-Jan-01 17:33 
GeneralRe: valid use of goto Pin
15-Jan-01 4:47
suss15-Jan-01 4:47 
GeneralA registry class Pin
Ben Burnett10-Jan-01 18:39
Ben Burnett10-Jan-01 18:39 
Generalwher do you want to GOTO today? Pin
Ghazi H. Wadi10-Jan-01 11:47
Ghazi H. Wadi10-Jan-01 11:47 
Generalgoto statement Pin
10-Jan-01 8:31
suss10-Jan-01 8:31 
GeneralError handling Pin
jkgh10-Jan-01 7:54
jkgh10-Jan-01 7:54 
GeneralRe: Error handling Pin
10-Jan-01 8:21
suss10-Jan-01 8:21 
GeneralRe: Error handling Pin
Christian Graus10-Jan-01 18:52
protectorChristian Graus10-Jan-01 18:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.