On Wed, 27 Dec 2006, Les Mikesell wrote:
On Wed, 2006-12-27 at 11:01 -0500, Gene Heskett wrote:
There is actually a goto in many languages, including C, C++ and I
think Java, but if you use goto in your C program, your colleagues
are liable to break your arms and knee-caps, knock out your teeth
and poke out your eyes with a corkscrew and actually get away with
it on grounds of justifiable self defence.
Boy! Those C people sound like a very bad group .
Back in the "Basic" days of computers they where more friendly.
Nah, its all propaganda from the "if you can't dazzle them with
brilliance, baffle them with technospeak" crowd.
Or ranting from someone who had to maintain code with thousands of
goto's to targets not visible on the same page and mostly slight
spelling variations of the same word. It is easy to lose the logic
if you can't track the program flow.
And that's dead on too, Les. Years ago I went through an amiga program
full of goto's and buggier than a 10 day old carcass, changing every goto
name into something I could remember. I found and fixed 7 or 8 bugs and
made a stable program out of it that way, but before I was done I
questioned every aspect of the authors breeding. That was back when I
had CommodeDoor stuff under the desk... Seems like yesterday but it was
probably in the early 90's.
Long before that, vi had bracket/brace matching: put the cursor
on a brace or bracket and hit the % key and the cursor would jump to
the corresponding start/end brace/bracket so it is easy to see the
scope of normal C flow control structures even in badly formatted
code. With goto's there not only is not any real structure to see,
there can be multiple references to a single target and no way at
all to track the "come from's".
Ah, reminds me of the old proposal to replace GOTOs with COMEFROMs. They
worked like this: As you were reading a sequence of statements you'd see
The following statements would be executed if control passed through in
line or if control was received by a branch from <line#>. The fun part
was that there was no indication to the reader at the statement <line#>
that control transferred from there to elsewhere in the program.
Made GOTOs seem downright comprehensible...
Clemson University Math Sciences
mjs AT clemson DOT edu