![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#41 |
|
Sexy Programmer
|
I was tempted to use goto in my VB programming class on this project I was doing, the teacher didnt accept b/c of that damn "goto" is not a valid statement. She said she wouldnt use them even if her teaching career was in dier need for it! To me, the thought seem good but then I said just take the advice of pros and dont use it but instead use "break".
__________________
I would love to change the world, but they won't give me the source code! |
|
|
|
|
|
#42 |
|
Resident Grouch
![]() ![]() ![]() ![]() ![]() ![]() Join Date: Jun 2005
Posts: 6,453
Rep Power: 10
![]() |
If one doesn't understand the lack of need for the 'goto' except in exceptional circumstances (I use the term, exceptional, advisedly), one doesn't understand programming. The normal path of a program is a logical progression from one point to another. Ocassionally a side trip is needed. Conditional statements provide for that. Ocassionally a tool or utility or object (and its methods) are needed. One calls upon them. The normal state of affairs is such that those called-upon adjuncts do their thangy and then return to the point at which they were invoked. Things roll along, things get done. Fatal errors can happen; errors which have no bearing on the point at which the program is operating, or only a minor relationship. Drastic measures may be called for. Modern language writers provide for that. 'Goto' wasn't their vehicle. Older languages require more than ordinary skills to deal with the problem if it's recalcitrant enough. One pulls out the wand and gets the rabbit from the hat. The rabbit may have goto-looking ears, but it's certainly not a given. I've never used a goto in C or C++. Why? If I'm in that kind of trouble, I'm usually under the hood finagling registers and the stack. Bad boy, bad boy, whatcha gonna do?
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code. Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers |
|
|
|
|
|
#43 | |
|
Programming Guru
![]() Join Date: Aug 2005
Location: England
Posts: 1,499
Rep Power: 4
![]() |
Quote:
![]() And I think the point DaWei and others are trying to make is twofold: 1. That there is never a good use for the goto statement 2. That you're confusing the goto statement with the gotosite function - they're two different things entirely. |
|
|
|
|
|
|
#44 |
|
Newbie
|
Ah.. Thankyou for clarifying this. And due to requesting that i not use the capitalization on every word, I will refrain. Thanks.. Now I am not quite so lost.. Lol!
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|