comp.lang.ada
 help / color / mirror / Atom feed
From: Peter Hermann <ica2ph@sinus.csv.ica.uni-stuttgart.de>
Subject: Re: Possible Ada deficiency? (goto)
Date: Wed, 12 Jan 2005 10:17:29 +0000 (UTC)
Date: 2005-01-12T10:17:29+00:00	[thread overview]
Message-ID: <cs2tfn$rsp$1@news.BelWue.DE> (raw)
In-Reply-To: wccmzvf3944.fsf@shell01.TheWorld.com

Robert A Duff <bobduff@shell01.theworld.com> wrote:
> The main thing I'm thinking about is that goto labels are implicitly
> declared.  The Pascal rule requires an explicit label declaration.
> That makes the code more readable, because you can see up front
> that "gotos lurk below", which is a useful thing to know.

maybe

> Even if you think the extra syntactic overhead is annoying, it can't be
> *very* annoying, because people don't write a lot of gotos.

yes. I was astonished after changing from Fortran to Ada
when I detected to never need any goto.
There are rare cases where a goto is useful.
(I am assuming you do not ban goto at all)
E.g. automatic translation from Fortran spaghetti into Ada.
The increase of workload of the translator is neglectable
(when translator=machine, annoying when man)
but the resulting code would be cluttered with label declarations,
which IMHO are of no added value.

> Also, this rule makes the language a little bit harder to learn, because

no

> goto labels don't behave like most everything else in the language,
> which *do* have to be explicitly declared.
> 
> How many Ada programmers know that the following silly example is
> illegal:
> 
>     procedure P is
>     begin
>         for Mumble in 1..10 loop

missing statement in loop

>             <<Mumble>> -- Illegal!
>             null;
>         end loop;
>     end P;
> 
> but the following equally silly example is legal:
> 
>     procedure P is
>     begin
>         <<Mumble>>

why not allow a practical "start over"?
Although my personal taste is to avoid goto_s
I welcome this syntactical feature for the comfort of the programer
in the sense of "let_it_be".

>         for Mumble in 1..10 loop
>             null;
>         end loop;
>     end P;
> 
> and can explain why?
> 
> Compiler writers have to work hard to get those little details exactly

once done, benefit thousandfold.

> right, and it's of zero benefit to programmers.

One of Ada's strengths is keeping mundane syntactical constructs alive
for the benefit(!) of programmer's comfort.
I like Ada for those many improvements concerning the taking over
of activities, now done by the compiler in place of the programmer.
Out of a long list of examples only a few examples:
  o   correct copying of overlapping vector slices
  o   atomic write of protected objects
  o   etc etc etc

Returning to my precious and almost never used goto :
It is carved in stone and I like it the way it is :-)
 
> If my passengers bought tickets from New York to Boston, I don't like to
> have a rule saying I have to drive the bus via Los Angeles!  ;-)
                    "I"   (-: not "they" :-)

anyway: thank you for the good laugh which brightens the day.

-- 
--Peter Hermann(49)0711-685-3611 fax3758 ica2ph@csv.ica.uni-stuttgart.de
--Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
--http://www.csv.ica.uni-stuttgart.de/homes/ph/
--Team Ada: "C'mon people let the world begin" (Paul McCartney)



  reply	other threads:[~2005-01-12 10:17 UTC|newest]

Thread overview: 102+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-31 18:15 Possible Ada deficiency? danmcleran
2004-12-31 19:12 ` Jeffrey Carter
2005-01-01  1:52   ` danmcleran
2005-01-01  2:37     ` Jeffrey Carter
2005-01-01  2:02   ` danmcleran
2005-01-01 14:11     ` Martin Krischik
2005-01-01 15:27       ` danmcleran
2005-01-02 17:49         ` Martin Krischik
2005-01-01 15:30     ` Stephen Leake
2005-01-01 15:57       ` danmcleran
2005-01-03 23:37         ` Randy Brukardt
2005-01-07 17:26           ` Nick Roberts
2005-01-07 18:26             ` danmcleran
2005-01-07 21:32             ` Randy Brukardt
2005-01-08  3:56               ` Nick Roberts
2005-01-08 18:15                 ` Robert A Duff
2005-01-08 19:11                   ` Jeffrey Carter
2005-01-08 20:03                     ` Robert A Duff
2005-01-09  3:40                       ` Jeffrey Carter
2005-01-09 17:30                         ` Robert A Duff
2005-01-09 19:24                           ` Jeffrey Carter
2005-01-09 21:56                           ` Nick Roberts
2005-01-10 13:47                             ` Dmitry A. Kazakov
2005-01-10 16:46                               ` Duncan Sands
2005-01-10 17:58                                 ` Pascal Obry
2005-01-10 18:45                                   ` Dmitry A. Kazakov
2005-01-10 19:44                                     ` Pascal Obry
2005-01-11 10:05                                       ` Dmitry A. Kazakov
2005-01-11  7:24                                     ` Vinzent 'Gadget' Hoefler
2005-01-11  9:48                                       ` Dmitry A. Kazakov
2005-01-11 13:57                                         ` Vinzent 'Gadget' Hoefler
2005-01-11 21:52                                           ` Robert A Duff
2005-01-12 11:22                                           ` Dmitry A. Kazakov
2005-01-09 17:23                   ` danmcleran
2005-01-09 17:46                     ` Robert A Duff
2005-01-10  3:05                       ` danmcleran
2005-01-09 18:41                   ` Nick Roberts
2005-01-09 19:06                     ` Martin Krischik
2005-01-09 20:10                     ` Robert A Duff
2005-01-09 20:15                     ` Robert A Duff
2005-01-11 14:13                       ` Possible Ada deficiency? (goto) Peter Hermann
2005-01-11 14:54                         ` Nick Roberts
2005-01-11 22:15                         ` Robert A Duff
2005-01-12 10:17                           ` Peter Hermann [this message]
2005-01-15 17:34                             ` Robert A Duff
2005-01-15 17:58                               ` Dmitry A. Kazakov
2005-01-15 19:34                                 ` Robert A Duff
2005-01-10 20:15                   ` Possible Ada deficiency? Randy Brukardt
2005-01-10 21:51                     ` Robert A Duff
2005-01-11 20:23                       ` Randy Brukardt
2005-01-11 21:24                         ` Robert A Duff
2005-01-12 19:57                           ` Randy Brukardt
2005-01-02 15:51       ` Adrian Hoe
2005-01-04 16:06       ` Peter Hermann
2005-01-01 23:36     ` tmoran
2005-01-02  3:38       ` danmcleran
2004-12-31 19:16 ` Martin Dowie
2005-01-01  2:32   ` Jeffrey Carter
2004-12-31 23:23 ` Nick Roberts
2005-01-01  1:56   ` danmcleran
2005-01-01 11:43 ` Dmitry A. Kazakov
2005-01-01 15:46   ` danmcleran
2005-01-01 17:58     ` Larry Kilgallen
2005-01-01 19:43       ` danmcleran
2005-01-02  0:36         ` Ed Falis
2005-01-02  3:36           ` danmcleran
2005-01-02 15:53             ` Ed Falis
2005-01-07 18:31               ` danmcleran
2005-01-07 18:44                 ` Pascal Obry
2005-01-07 19:29                   ` danmcleran
2005-01-07 21:28                     ` Pascal Obry
2005-01-01 23:28   ` danmcleran
2005-01-02 10:26     ` Dmitry A. Kazakov
2005-01-02 15:51       ` danmcleran
2005-01-03 23:48     ` Randy Brukardt
2005-01-01 14:06 ` Martin Krischik
2005-01-01 15:53   ` danmcleran
2005-01-07 21:33 ` Robert A Duff
2005-01-09 17:15   ` danmcleran
2005-01-09 17:38     ` Robert A Duff
2005-01-10  3:16       ` danmcleran
2005-01-09 18:41     ` Martin Dowie
2005-01-10  3:18       ` danmcleran
2005-01-10 20:32         ` Randy Brukardt
2005-01-10 21:42           ` danmcleran
2005-01-10 21:36         ` Robert A Duff
2005-01-10 21:44           ` danmcleran
2005-01-09 19:01     ` Jeffrey Carter
2005-01-10  3:20       ` danmcleran
2005-01-10 22:16         ` Robert A Duff
2005-01-10 22:29           ` danmcleran
2005-01-11 20:12             ` Georg Bauhaus
2005-01-11 20:30               ` danmcleran
2005-01-11 21:44               ` Robert A Duff
2005-01-11  0:06           ` Jeffrey Carter
2005-01-11  0:46             ` Robert A Duff
2005-01-11 20:37           ` danmcleran
2005-01-11 21:08             ` Robert A Duff
2005-01-17  4:40 ` Tucker
2005-01-18 13:46   ` danmcleran
2005-01-18 21:29     ` Nick Roberts
2005-01-24 17:23   ` danmcleran
replies disabled

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