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


Michael Brenner says

<<Comment: section 3 (b) on efficiency should be moved up to being
the primary reason for using GOTOs in FSAs, other posts notwithstanding.>>

I agree that few (but not no) compilers will be able to convert the canonical
case/state formulation to the formulation with jumps, so it is certainly
reasonable to cite the efficiency argument.

Still I think the cases in which one should let efficiency dominate stylistic
considerations are very rare. To do this other than in cases where you really
KNOW that the efficiency is that critical seems to be to be premature
optimization. In addition, the general approach of trying to outguess an
optimizing compiler often leads people to do quite counterproductive things.

Within broad boundaries, I think the best approach is to write in the
clearest way possible, and then, if there is an efficiency problem, examine
ways to improve the code.

I say within broad boundaries, because one needs to have a reasonable feel
for gross levels of efficiency. For example, I sometimes see Ada 95 
programs where controlled types have been used with complete abandon and
obvious obliviousness to the fundamental inefficiencies that result.

But I would seldom chose between ways of doing things on an efficiency
basis, and I certainly would not do so in this case. I would use the
goto approach because I think it is clearer, even if it was less efficient,
unless I found that it made a critical efficiency difference.

Obviously if you do not share the quite common view that the goto
representation of FSM's (i.e. encoding the state in the code location)
is clearer, then you will think that efficiency is the concern, but to
elevate efficiency as the primary motive in this document would be quite
misleading, since it would miss the point that the FSM case is one of 
those rare cases where a significant number of people *do* consider
that the goto representation is clearer.





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

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-06-11  0:00 GOTO considered necessary (reworked) Samuel Mize
1997-06-11  0:00 ` Bryce Bardin
1997-06-12  0:00 ` Anonymous
1997-06-12  0:00   ` John G. Volan
1997-06-16  0:00     ` Anonymous
1997-06-12  0:00   ` Robert Dewar
1997-06-12  0:00     ` John G. Volan
1997-06-13  0:00       ` Robert A Duff
1997-06-16  0:00         ` John G. Volan
1997-06-17  0:00           ` Robert Dewar
1997-06-17  0:00             ` Robert A Duff
1997-06-18  0:00               ` Spam Hater
1997-06-20  0:00               ` Robert Dewar
1997-06-20  0:00               ` Robert Dewar
1997-06-21  0:00                 ` Robert A Duff
1997-06-21  0:00                   ` Robert Dewar
1997-06-25  0:00               ` Wolfgang Gellerich
1997-06-25  0:00                 ` Michael F Brenner
1997-06-26  0:00                   ` Wolfgang Gellerich
1997-06-25  0:00                 ` Samuel T. Harris
1997-06-19  0:00             ` Karel Th�nissen
1997-06-19  0:00               ` Karel Th�nissen
1997-06-23  0:00               ` John G. Volan
1997-06-23  0:00                 ` Robert Dewar
1997-06-24  0:00                   ` Brian Rogoff
1997-06-25  0:00                   ` Featuritis not always bad (was re: GOTO considered necessary) Karel Th�nissen
1997-06-26  0:00                     ` Robert Dewar
1997-06-26  0:00                       ` Karel Th�nissen
1997-06-23  0:00                 ` GOTO considered necessary (reworked) Spam Hater
1997-06-25  0:00                 ` Karel Th�nissen
1997-06-23  0:00             ` John G. Volan
1997-06-17  0:00           ` Robert I. Eachus
1997-06-17  0:00           ` Robert A Duff
1997-06-25  0:00             ` Van Snyder
1997-07-21  0:00           ` Shmuel (Seymour J.) Metz
1997-06-12  0:00 ` Michael F Brenner
1997-06-17  0:00   ` Robert Dewar [this message]
1997-06-17  0:00     ` Robert A Duff
1997-06-20  0:00       ` Robert Dewar
1997-06-21  0:00         ` Robert A Duff
1997-06-21  0:00           ` Robert Dewar
1997-06-13  0:00 ` Robert A Duff
1997-06-14  0:00   ` Robert Dewar
1997-06-16  0:00     ` Robert A Duff
1997-06-17  0:00       ` Spam Hater
1997-06-17  0:00         ` Robert Dewar
1997-06-17  0:00           ` Robert A Duff
1997-06-19  0:00             ` John Herro
1997-06-25  0:00               ` Function result Van Snyder
1997-06-27  0:00                 ` Robert Dewar
1997-06-27  0:00                 ` Jon S Anthony
1997-06-20  0:00             ` GOTO considered necessary (reworked) Robert Dewar
1997-06-17  0:00           ` Spam Hater
1997-06-17  0:00         ` Robert A Duff
1997-06-19  0:00           ` Spam Hater
1997-06-16  0:00     ` Spam Hater
1997-06-17  0:00       ` Robert Dewar
1997-06-17  0:00         ` Spam Hater
1997-06-14  0:00   ` Samuel Mize
1997-06-14  0:00     ` Matthew Heaney
1997-06-14  0:00   ` Samuel Mize
1997-06-16  0:00 ` Anonymous
1997-06-16  0:00   ` Robert Dewar
replies disabled

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