From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b8b8a54001adc4d2 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!news.uni-stuttgart.de!news.belwue.de!not-for-mail From: Peter Hermann Newsgroups: comp.lang.ada Subject: Re: Possible Ada deficiency? (goto) Date: Wed, 12 Jan 2005 10:17:29 +0000 (UTC) Organization: InterNetNews at News.BelWue.DE (Stuttgart, Germany) Message-ID: References: <1104516913.718856.94090@z14g2000cwz.googlegroups.com> <1104544963.930877.75170@c13g2000cwb.googlegroups.com> <1104595073.731663.180100@c13g2000cwb.googlegroups.com> NNTP-Posting-Host: sinus.csv.ica.uni-stuttgart.de X-Trace: news.BelWue.DE 1105525049 28569 129.69.118.70 (12 Jan 2005 10:17:29 GMT) X-Complaints-To: news@news.belwue.de NNTP-Posting-Date: Wed, 12 Jan 2005 10:17:29 +0000 (UTC) User-Agent: tin/1.7.4-20040111 ("Taransay") (UNIX) (Linux/2.4.27 (i686)) Xref: g2news1.google.com comp.lang.ada:7681 Date: 2005-01-12T10:17:29+00:00 List-Id: Robert A Duff 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 > <> -- Illegal! > null; > end loop; > end P; > > but the following equally silly example is legal: > > procedure P is > begin > <> 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)