comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: GOTO considered necessary
Date: 1997/06/08
Date: 1997-06-08T00:00:00+00:00	[thread overview]
Message-ID: <dewar.865771872@merv> (raw)
In-Reply-To: 5ncp5a$n1d@top.mitre.org


Michael Brenner says

<<Item 4 states that GOTOs in FSAs are done to match the style of what
an FSA actually is. I disagree.>>


Nope, that is wrong. People certainly disagree on the issue of whether
labels/gotos or a case statement are preferable in representing FSA's, but
the issue is NOT speed. Many people, including me certainly, think that it
is CLEARER to express an FSA in terms of labels and gotos, because it is
a clearer representation of the diagram with labels being the states, and
gotos the arrows.

Many excellent and experienced programmers agree with this point of view,
and many do not. It is a pointless argument at this stage because nothing
new is likely to be added (Michael, you are relatively new to this group,
so you may not have seen previous threads on this topic).

But you are quite wrong if you think the concern is about efficiency. I
would prefer the representation with labels and gotos even if it were
*less* efficient if I was concerned primarily about clarity. 

You cannot argue that one way is clearer than another here, since this is
really a case of personal preference. You can argue that Michael Brenner
finds the case representation clearer, and I can argue that Robert Dewar
finds the label/goto form clearer, but so what?

What is certainly the case is that for many (in my experience a slight, but
only slight, majority) of experienced programmers, this is one of the few
situations in which they feel the use of gotos is not only permissible,
but indeed desirable.

Two little anecdotes. Once Jean Ichbiah was looking at some code I was
writing for the Alsys compiler, and expressed surprise at the use of 
gotos. I replied that it was a FSA, and he immediately agreed that in 
that case it was fine.

Second, Fran Allen tells a story about one of the most experienced compiler
writers at IBM using gotos extensively in the lexical scanner of a compiler.
But at that time, IBM standards permitted no more than X% of source lines to
be gotos, and this code required high level management approval ...





  reply	other threads:[~1997-06-08  0:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-06  0:00 GOTO considered necessary Samuel Mize
1997-06-06  0:00 ` Michel Gauthier
1997-06-07  0:00 ` Michael F Brenner
1997-06-08  0:00   ` Robert Dewar [this message]
1997-06-17  0:00     ` GOTO considered necessary (FSAs) Nick Roberts
1997-06-07  0:00 ` GOTO considered necessary Robert Dewar
1997-06-17  0:00   ` Woodrow Yeung
1997-06-20  0:00     ` Robert Dewar
1997-07-09  0:00       ` Woodrow Yeung
1997-06-23  0:00     ` Adam Beneschan
1997-06-09  0:00 ` Wolfgang Gellerich
1997-06-09  0:00 ` Anonymous
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox