View Single Post
Old Feb 21st, 2006, 5:50 PM   #42
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
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
DaWei is offline   Reply With Quote