Goto still considered helpful



On Sep 6, 8:11 pm, Richard Heathfield <r...@xxxxxxxxxxxxxxx> wrote:
On reading the entirety of James's article,
Richard concludes that James has completely failed to
convince Richard that James is an idiot. Would
James care to try again? :-)

Sorry to take so long to get back to you
on this. Often my stupid-seemingest posts
are ones I spend effort preparing, but I've
been busy working on a book. (Nothing to do
with C language, all will be happy to note.)

I thought of replying to one of your posts showing
your gcc command line with
Didn't you forget an option?
-Wwarn_about_excessive_number_of_long-named_warning_options
but was afraid that might be judged as simply poor
humor rather than stupidity.

Here's my submission:

Wasn't it you, Richard, who recently wrote:
Firstly, I would just like to point out that it's rarely
a good idea to use goto (in fact, I've never come across
a good reason to use it in "real" code).

Let me refer Honourable Members to a
reply I gave some years ago in this ng:
http://groups.google.com/group/comp.lang.misc/msg/90274cfe18bb3117?dmode=source

Tim Rentsch posted a "structured alternative" to
my Favorite-Goto Bridge Solving Program. It and
the "unstructured alternative" are shown here:
http://james.fabpedigree.com/gotoalt.htm
I do hope readers will indicate which version
is "more readable."

As noted on the webpage, in order to get rid
of the 'goto' and its associated label, Tim's
version
replaces
* four "natural" for-loops (which work
together smoothly *because* of the goto)
with
* two for_ever loops nested inside a third
for_ever loop, as well as two break's, four
if's, two else's, and four inside-loop state
changing fragments (all required because the
"natural" for-loop headers were expunged
to get rid of goto);
replaces
* a single return at end of function
with
* a single return inside an inner loop;
replaces
* a single initialization
with
* two instances of this same initialization.

(I don't claim that Inside-loop returning or replicated
initialization is a fault of the same magnitude as goto,
just that the need for them in Tim's version suggests
that my version (with goto) better captures the program's
natural structure.)

James Dow Allen

.



Relevant Pages

  • Jeremy Clarkson article - Richard is winning his fight
    ... Two years ago, Richard Hammond, James May and I agreed on a plan of action should one of us be killed while making our show, Top Gear. ... The idea to drive a jet car actually came from Hammond. ...
    (uk.media.tv.misc)
  • Re: Jeremy Clarkson article - Richard is winning his fight
    ... almost certainly the world's fastest ever car crash, Richard Hammond ... The idea to drive a jet car actually came from Hammond. ... James May being given the assignment. ...
    (uk.media.tv.misc)
  • Re: winterlich
    ... Colonia "Traeger Des Helmes I. Klasse in Plastik" Furchtloser ... Erforscher Op-loser Foren, Patenvater, Datenschutzbeauftragter des KF, ... der Wartehaeuschenkette 'James wait here' doch gar nicht aus! ... Richard ein Bild vom Yeti vor Augen habe. ...
    (de.talk.misc)
  • Re: Can anyone offer assitance with this script?
    ... Richard, as always, I appreciate your input. ... was always a "real" place where the GOTO pointed. ... With normal error handling, ... while the error condition exists (assuming program execution has not ...
    (microsoft.public.scripting.vbscript)
  • Re: winterlich
    ... James. ... ich haette Dein Bild im KStA gesehen! ... Direktor SysOp Sir Thomas James of Delphi A. Richard Lord Helmchen of ... Richard ein Bild vom Yeti vor Augen habe. ...
    (de.talk.misc)