comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: GOTO considered necessary
Date: 1997/06/07
Date: 1997-06-07T00:00:00+00:00	[thread overview]
Message-ID: <dewar.865693869@merv> (raw)
In-Reply-To: 5n977i$2cmc$1@prime.imagin.net


Sam says

<<2) As a rule of thumb, if your code needs a "goto" to work efficiently
   (or at all), you have probably overlooked a simpler, better design.
>>

Oh dear, yes, this horse is truly dead and almost mummified one would say,
but the above rule of thumb is far too dogmatic (and see Knuth by all means!)

There are many places where a goto is the natural and clearest way of doing 
things. It is true that there exist programmers who are so incompetent that
the only way of stopping them from misusing gotos is to stop them from using
them at all, but assuming you are not in this category, there is no reason
to write convoluted code to avoid a goto.

THere are many obvious examples, one of the most familiar is to provide
a continue facility for loops

    while ..... loop
       ...
       <<Continue>>
    end loop;





  parent reply	other threads:[~1997-06-07  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
1997-06-17  0:00     ` GOTO considered necessary (FSAs) Nick Roberts
1997-06-07  0:00 ` Robert Dewar [this message]
1997-06-17  0:00   ` GOTO considered necessary 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