View Poll Results: How often have you used 'goto' in the last 5 years?
- Voters
- 111. You may not vote on this poll
-
February 15th, 2004, 09:34 AM
#1
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!
-
February 15th, 2004, 11:31 AM
#2
I think once
All the buzzt
CornedBee
-
February 15th, 2004, 11:47 AM
#3
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
-
February 15th, 2004, 11:59 AM
#4
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.
/Jonas
-
February 15th, 2004, 12:27 PM
#5
Just as a side note. I performed a search on my entire VC++.NET directory for goto and it returned 2287 hits.
TDM
-
February 15th, 2004, 12:30 PM
#6
I hate them. I support code that uses them to perform loops. It's very confusing to follow.
-
February 15th, 2004, 12:43 PM
#7
I also use goto for cleanup. In my case I implement both cleaning up and error checking via a #define'd macro which uses goto. It's the only use I've ever found for it - but I do use that macro in every program I write.
-
February 15th, 2004, 12:52 PM
#8
Originally posted by John E
I also use goto for cleanup. In my case I implement both cleaning up and error checking via a #define'd macro which uses goto. It's the only use I've ever found for it - but I do use that macro in every program I write.
Me too. I only use goto for cleanup/error handling (jumping downwards, never upwards). This is (according to me) a good, defensive programming style.
-
February 15th, 2004, 01:23 PM
#9
I don't recall using a "go to" anytime in the past 30 years except when the language (not C/C++) requires it to do what needs to be done, such as "On Error GoTo" in VB. I have never, ever used a goto in C or C++.
If you don't understand the disadvantages of a goto then it is unlikely anyone can explain them. The disadvantages of a goto are not clear when considering it alone. The disadvantages are very clear when considering it in the context of a methodology such as Structured Programming.
-
February 15th, 2004, 01:27 PM
#10
Originally posted by j0nas
Me too. I only use goto for cleanup/error handling (jumping downwards, never upwards). This is (according to me) a good, defensive programming style.
I think for error handling try/catch provides equivalent capability and most C++ programmers would use try/catch.
-
February 15th, 2004, 01:37 PM
#11
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.
Indeed a very good request, I would be interested in these as well...
-
February 15th, 2004, 01:38 PM
#12
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.
Well..what did you expect?
-
February 15th, 2004, 01:40 PM
#13
Originally posted by John E
I also use goto for cleanup. In my case I implement both cleaning up and error checking via a #define'd macro which uses goto. It's the only use I've ever found for it - but I do use that macro in every program I write.
Okay...that makes two evil things at the same time...macros and goto's...
As being pointed out, for error handling there are much better techniques than using 'goto' - of course this is only my view of the thing...
-
February 15th, 2004, 01:46 PM
#14
Originally posted by Andreas Masur
As being pointed out, for error handling there are much better techniques than using 'goto' - of course this is only my view of the thing...
Not in C (btw: I don't combine goto:s and macros).
-
February 15th, 2004, 01:51 PM
#15
Originally posted by Andreas Masur
Indeed a very good request, I would be interested in these as well...
What do you and others find interesting in knowing that? Do you think source codes that have goto:s in them are bad software or what?
PS. I've already mentioned, in this thread, the product name I'm developing.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|