Re: Simple question!
 
"Bo Persson" <bop@gmb.dk> wrote:
I can see that many attribute some inherently evil 
properties to `goto' statement. Michael K. O'Neill 
already posted good article in this thread. I'd second 
his opinion. There is nothing wrong with `goto' per se. 
All of us have seen horrible code without single `goto'. 
This is not that `goto' (or any other language construct) 
that makes code bad; it's quite the opposite: bad, stupid 
coders produce filthy code (no matter what the language 
the use for that). Any feature in a programming language 
is just a tool. Use it wisely and you'll get beautiful 
elegant code. I just can't get all these rumbles about 
`goto'.
Because it is an inherently unstructured way to get from 
one arbitary point in the program to another?  :-)
First, it is not so arbitrary. It must be within the same 
function. Second, the whole engineering thing is about 
tradeoffs. Sometimes maintaining 100% pureness of whatever 
concept has unacceptable cost. At that point smart thing to 
do is to permit reasonable tradeoff. Not so smart thing to 
do is to fight reality for sake of academic "correctness". 
In my experience better engineer is that one who knows where 
to draw the line rather who knows a lot of techniques 
(though, it's also important).
When 99.9% of the uses are bad, the general advise to 
students is: "Don't use it"!
I'm not so sure about the percentage. Just grep CRT sources 
for `goto'. Also, I'm not comfortable with general advices 
to students. Too often we can see fresh graduates with heads 
full of such do's and dont's: C++ is bad because of pointers 
and Java is good; all must be implemented in strict OOP way, 
with getters and setters; never ever use goto, otherwise 
you'll die; etc. etc..
Instead of stuffing students' heads with its own 
idiosyncrasies, academy should encourage in them inquiring 
spirit, readiness and willingness to think before applying 
learned by heart methods.
`goto' statement is like litmus paper that instantly shows 
two kinds of developers: those who immediately say "Don't!" 
and those who say "Let's see what's the situation."