If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

View Poll Results: How often have you used 'goto' in the last 5 years?

Hybrid View

The grand 'goto' poll

Okay - it's not very grand at all but here goes - the purists among us would prefer a world without 'goto'. The pragmatists among us think that it's 'sometimes' the right tool for the job, so let's have a vote.

How often have you used 'goto' in the last 5 years or so? Be honest - this is an anonymous poll so no-one needs to be embarrassed or fear for their reputation...! It's just a survey. No-one will get hung!

Originally posted by Paul McKenzie
A request for anyone voting that they use goto regularly in a C++ program:

Please tell us the name of your software product(s) where you have used goto regularly.

Regards,

Paul McKenzie

I use goto regularly when programming in C (for cleanup). I have probably also used it in C++, but the product I'm working with, is mostly written in C. It's a Windows security product (PKI), running on WinNT/2000/XP clients. The name is RSA Keon Desktop or TFS Desktop.

Re: The grand 'goto' poll

Heck I just want to be part of a goto thread, I have always admired these things...

//As a side note.. I have never used goto, but I don't know why, It just seems to
//have turned out that way. I think I am goig to put a goto into the C++ code I
//am wrting right now, just because I don't like people telling me what to do, and
//this goes double if the person is a Professor

Last edited by souldog; September 28th, 2004 at 06:55 PM.

Wakeup in the morning and kick the day in the teeth!! Or something like that.

Re: The grand 'goto' poll

Quite a few languages have "goto" statements and they may or may not be necessary depending on the structure of the language. Every assembly language I ever used had a goto and you needed to use it. There was no way around it. I believe Basic has a necessary goto also (I have very little experience with Basic). I can't remember if Fortran does or not (I haven't even seen Fortran since my college days).

Goto is a part of C (and C++), but the structure of the language makes it unnecessary except for handling some extreme error conditions. The language has a better way of writing a program.

There is some dogmatism about goto in C and C++, but there are some practical reasons for it too. Not only is a program listing more readable by a human without gotos, but I don't believe modern optimizing compilers won't optimize code with a lot of gotos very well, which will make the program run slower.

Re: The grand 'goto' poll

Hello??? Someone right there?
Mmmmm... long time this thread has been inactive... and has not come to Holy War... maybe it did while I was away and then they were all nuked and no one survived to discuss gotos...

Mmmm... I'm getting bored...

This poll was getting SO good. Maybe we can restart this thread and get much more fun...

Re: The grand 'goto' poll

Originally Posted by TDM

Just as a side note. I performed a search on my entire VC++.NET directory for goto and it returned 2287 hits.

It just seems to be "non-optimized code, that is specifically designed for debugging purposes only. Have you find a single goto in any sample code available in MSDN?
The required binaries, which are linked in Release mode, must not be having any gotos at all...