comp.lang.ada
 help / color / mirror / Atom feed
From: fred@genesis.demon.co.uk (Lawrence Kirby)
Subject: Re: Programming language vote - results
Date: 1997/11/26
Date: 1997-11-26T00:00:00+00:00	[thread overview]
Message-ID: <880510760snz@genesis.demon.co.uk> (raw)
In-Reply-To: $2oaKBAp0xe0EwNL@dowie-cs.demon.co.uk


In article <$2oaKBAp0xe0EwNL@dowie-cs.demon.co.uk>
           martin@dowie-cs.demon.co.uk "Martin M Dowie" writes:

>In article <347B17AC.5A53@mWilden.com>, Mark Wilden <Mark@mWilden.com>
>writes
>>Martin M Dowie wrote:
>>> 
>>> i've heard many people use this "where it is simply the best approach"
>>> 'reason' - care to given an example? [of goto]

A good example is breaking out of nested loops, say for code that is
searching for a value in a 2 dimensional array datastructure. Possibly
a more flexible form of the break statement would have been the answer
here but since we don't have that goto is the best solution. The Pascal
solution would probably be to create some sort of flag variable but that
just obscures the algorithm which is not a good idea if it can be avoided.

>>I've found goto the best way to branch in a simple state machine.
>
>in what why is this 'the best'? surely an enumeration type containing
>each possible state together with a local static variable used in an
>infinite loop would produce more readable safer and _provable_ code?

You would need to demonstrate that it is any of these things. Most of the
state machines I've written have taken the form you suggest but that is
for a specific reason that I've tended to want to preserve the state between
calls to the function containing the FSM, therefore the state needs to
be held in a variable. Where that isn't the case a goto based implementation
is quite natural. A FSM has structure but it is not of the same form
as that supported by structured languages. So trying to implement it
using structured language concepts isn't an automatic win. In fact by doing
so you're adding an extra layer of complexity.

>or
>is that loop up to the top of a case/guarded select statement too
>much?..

We're comparing two approaches, not asking in an absolute sense whether
one approach is acceptable or not. 

-- 
-----------------------------------------
Lawrence Kirby | fred@genesis.demon.co.uk
Wilts, England | 70734.126@compuserve.com
-----------------------------------------





  reply	other threads:[~1997-11-26  0:00 UTC|newest]

Thread overview: 147+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <343fbb5a.0@news.iprolink.ch>
1997-10-11  0:00 ` Programming language vote - results Gary L. Scott
1997-10-12  0:00   ` Jack Rudd
1997-10-13  0:00     ` Robert Munck
1997-10-13  0:00       ` Gary L. Scott
1997-10-13  0:00       ` Jack Rudd
1997-10-13  0:00     ` safetran
1997-10-13  0:00       ` Jack Rudd
1997-10-14  0:00         ` Philip Brashear
1997-10-14  0:00           ` Gary L. Scott
1997-10-13  0:00       ` FRS DES
1997-10-13  0:00     ` Gary L. Scott
     [not found]     ` <3442B745.5352@lmco.com>
1997-10-15  0:00       ` Gary L. Scott
1997-10-16  0:00       ` James Giles
1997-10-16  0:00         ` Andrew Haley
1997-10-13  0:00   ` David Ness
1997-10-14  0:00     ` Randy MacDonald
1997-10-14  0:00     ` Jan Karman
1997-10-15  0:00       ` Alan E & Carmel J Brain
1997-10-15  0:00         ` D'Arcy J.M. Cain
1997-10-15  0:00           ` FRS DES
1997-10-15  0:00           ` Mark Stephen
1997-10-17  0:00             ` Randy MacDonald
1997-10-16  0:00           ` Alan E & Carmel J Brain
1997-10-16  0:00             ` FRS DES
1997-10-17  0:00               ` Jerry van Dijk
1997-10-16  0:00             ` John Sullivan
1997-10-17  0:00               ` Alan E & Carmel J Brain
1997-10-17  0:00                 ` John Sullivan
1997-10-17  0:00               ` Randy MacDonald
1997-10-17  0:00             ` Randy MacDonald
1997-10-20  0:00               ` Alan E & Carmel J Brain
1997-10-20  0:00                 ` Lawrence Kirby
1997-10-20  0:00                   ` Kaz
1997-10-21  0:00                     ` Alan E & Carmel J Brain
1997-10-23  0:00                     ` Ada Readability (Re: Programming language vote - results) Ray Blaak
1997-10-21  0:00                   ` Programming language vote - results Alan E & Carmel J Brain
1997-10-20  0:00                 ` FRS DES
1997-10-21  0:00                   ` Alan E & Carmel J Brain
1997-10-21  0:00                 ` Randy MacDonald
1997-10-22  0:00                   ` Don Guinn
1997-10-29  0:00                     ` Randy MacDonald
     [not found]                     ` <01bce1bf$5c2baaa0$95b66bcf@dkelly.ark.com>
1997-10-29  0:00                       ` Don Guinn
1997-10-29  0:00                         ` Shmuel (Seymour J.) Metz
1997-10-31  0:00                         ` Documenting Code (was:Programming language vote - results) Alan E & Carmel J Brain
1997-10-30  0:00                           ` Charles Lin
1997-10-30  0:00                             ` James L. Ryan
1997-10-31  0:00                               ` Robert Bernecky
1997-10-31  0:00                             ` Robert Bernecky
1997-11-01  0:00                           ` Randy MacDonald
1997-11-01  0:00                             ` Robert Dewar
1997-11-03  0:00                               ` Jon S Anthony
1997-10-29  0:00                       ` Programming language vote - results FRS DES
1997-10-25  0:00                   ` Alan E & Carmel J Brain
1997-10-26  0:00                     ` functionality of Java (was Re: Programming language vote - results) Randy MacDonald
1997-10-23  0:00                 ` Programming language vote - results Jack Rudd
1997-10-25  0:00                   ` Alan E & Carmel J Brain
1997-10-25  0:00                     ` Kaz
1997-10-26  0:00                       ` FRS DES
1997-10-27  0:00                       ` Robert Bernecky
1997-10-27  0:00                         ` APL argument W. Wesley Groleau x4923
1997-10-28  0:00                           ` Randy MacDonald
1997-10-28  0:00                         ` Programming language vote - results Jan Karman
1997-10-28  0:00                           ` Robert Bernecky
1997-10-28  0:00                             ` James L. Ryan
1997-10-29  0:00                               ` Robert Bernecky
     [not found]                                 ` <bosworth-2910972044300001@access59.accsyst.com>
1997-10-30  0:00                                   ` Robert Bernecky
1997-10-30  0:00                                     ` James L. Ryan
1997-10-31  0:00                                       ` Robert Bernecky
1997-10-31  0:00                                         ` James L. Ryan
1997-10-29  0:00                     ` Jack Rudd
1997-10-25  0:00                 ` Peter Seebach
1997-11-18  0:00                   ` Ingemar Ragnemalm
1997-11-18  0:00                     ` Kevin Swan
1997-11-29  0:00                       ` Ingemar Ragnemalm
1998-09-10  0:00                         ` Steven Katz
1997-11-18  0:00                     ` Lawrence Kirby
1997-11-24  0:00                       ` Martin M Dowie
1997-11-25  0:00                         ` Kaz Kylheku
1997-11-26  0:00                           ` Peter Seebach
1997-12-02  0:00                           ` ANDREAS LEITNER
1997-12-02  0:00                             ` Robert Dewar
1997-12-02  0:00                             ` Lawrence Kirby
1997-12-03  0:00                               ` Billy Chambless
1997-12-03  0:00                                 ` Robert Dewar
1997-12-05  0:00                             ` John Sullivan
1997-11-25  0:00                         ` Mark Wilden
1997-11-25  0:00                           ` Martin M Dowie
1997-11-26  0:00                             ` Lawrence Kirby [this message]
1997-11-26  0:00                           ` FRS DES
1997-11-18  0:00                     ` firewind
1997-11-18  0:00                       ` Kevin Swan
1997-11-19  0:00                         ` Alan E & Carmel J Brain
1997-11-18  0:00                       ` Larry Elmore
1997-11-20  0:00                         ` firewind
1997-11-19  0:00                       ` Mike Smith
1997-11-19  0:00                         ` Matt
1997-11-20  0:00                         ` firewind
     [not found]                           ` <3474C71B.536B12F6@cgocable.net>
1997-11-21  0:00                             ` CVigue
1997-11-23  0:00                           ` Lawrence Kirby
1997-11-24  0:00                             ` FRS DES
1997-11-20  0:00                       ` Terry Richards
1997-11-20  0:00                         ` Andy Knight
1997-11-23  0:00                         ` Alex Krol
1997-11-25  0:00                         ` William Tanksley
1997-11-26  0:00                           ` Ron Natalie
1997-11-27  0:00                             ` William Tanksley
1997-11-27  0:00                               ` Lawrence Kirby
     [not found]                                 ` <65keij$mkd$1@nerd.apk.net>
1997-11-27  0:00                                   ` Kaz Kylheku
1997-11-28  0:00                               ` Shmuel (Seymour J.) Metz
1997-12-01  0:00                                 ` FRS DES
1997-11-20  0:00                       ` Coding for Obscurity Alan E & Carmel J Brain
1997-11-20  0:00                         ` Stephan Wilms
1997-11-21  0:00                           ` Jos A. Horsmeier
1997-11-23  0:00                           ` Alex Krol
1997-11-24  0:00                             ` Jim Johnson
1997-11-24  0:00                               ` Mark Wilden
1997-11-26  0:00                                 ` Robert S. White
1997-11-26  0:00                                   ` Leon Jones
1997-11-26  0:00                                     ` Lawrence Kirby
1997-11-26  0:00                                     ` Ron Natalie
1997-11-27  0:00                                       ` Joerg Rodemann
1997-11-26  0:00                                   ` Mark Wilden
1997-11-26  0:00                                   ` Miguel Carrasquer Vidal
1997-12-01  0:00                                     ` ISONE
1997-12-01  0:00                                     ` ISONE
1997-11-27  0:00                                   ` Richard A. O'Keefe
1997-11-23  0:00                           ` Al Christians
1997-11-24  0:00                           ` Richard A. O'Keefe
1997-11-24  0:00                             ` Samuel T. Harris
1997-11-24  0:00                               ` Jon S Anthony
1997-11-25  0:00                                 ` Samuel T. Harris
1997-11-24  0:00                             ` Matt
1997-11-24  0:00                               ` Ed Falis
1997-11-20  0:00                         ` firewind
1997-11-20  0:00                           ` Jos A. Horsmeier
1997-11-20  0:00                       ` Programming language vote - results Andy Knight
1997-11-20  0:00                         ` firewind
1997-11-19  0:00                     ` Peter Seebach
1997-11-19  0:00                     ` Alan E & Carmel J Brain
1997-10-16  0:00           ` Randy MacDonald
     [not found]           ` <01bcdad2$fa9fdf60$25a43a91@basil.omroep.nl>
1997-10-17  0:00             ` D'Arcy J.M. Cain
1997-10-17  0:00         ` Robert I. Eachus
1997-10-13  0:00   ` Robert S. White
1997-10-13  0:00     ` Gary L. Scott
1997-10-13  0:00   ` Matthew Heaney
1997-10-14  0:00     ` Gary L. Scott
1997-10-19  0:00 ` William Rapp
replies disabled

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