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,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!f14g2000cwb.googlegroups.com!not-for-mail From: "Jerry Coffin" Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 18 Mar 2005 00:22:07 -0800 Organization: http://groups.google.com Message-ID: <1111134127.050469.12930@f14g2000cwb.googlegroups.com> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <1110052142.832650@athnrd02> <1110284070.410136.205090@o13g2000cwo.googlegroups.com> <395uqaF5rhu2mU1@individual.net> <1110377260.350158.58730@z14g2000cwz.googlegroups.com> <1110383768.773379.61780@o13g2000cwo.googlegroups.com> <399tkeF5utki4U1@individual.net> <1110427239.506093.96160@o13g2000cwo.googlegroups.com> <399vgoF5tsn8uU3@individual.net> NNTP-Posting-Host: 70.33.25.135 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1111134132 31190 127.0.0.1 (18 Mar 2005 08:22:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 18 Mar 2005 08:22:12 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: f14g2000cwb.googlegroups.com; posting-host=70.33.25.135; posting-account=mZiOqwwAAAC5YZsJDHJLeReHGPXV5ENp Xref: g2news1.google.com comp.lang.ada:9584 comp.lang.c++:46246 comp.realtime:1562 comp.software-eng:5147 Date: 2005-03-18T00:22:07-08:00 List-Id: Wes Groleau wrote: [ ... ] > Interesting. Ada is bad because you _think_ it won't let you do what > you want to do. First of all, I've never said Ada was bad -- at worst, I've said that I found some things about it frustrating. Second, my opinions are based on use, not just what I think might be true about it. Finally, I've openly admitted that some (pehaps all) of my opinions may be obsolete since my experience predates Ada 95. > But it would be better if it prevented other people > from doing something you think they shouldn't do. It's been close to 10 years now that Java has had its multi-level break, and in that time I'm not at all certain I've seen even _one_ instance of its use that wouldn't have been better off without it. In the end, designing a (good) programming language requires a lot of judgement calls, not simply applying some simplistic rule like "allow everything". A theoretically ideal programming language would allow everything that was intended and desired, but stop everything that wasn't. Real languages deal in compromises -- one is that permitting more of what people want to do also generally allows more things they didn't really want to do. I think this "feature" has an even greater cost though. While most people recognize that the undisguised goto is something to generally avoid, many (especially those too young to have dealt with FORTRAN II computed gotos) rarely consciously realize that a break (of any sort) is simply a restricted form of a goto -- and the less restricted it is, the more it's just a goto by a different name. The result is that when people are faced with using a goto to exit from a deeply nested loop, they usually have second thoughts -- and with a little more thought, realize that the code can be re-structured to eliminate the real problem that led them to want to do that in the first place. OTOH, when that goto is disguised as a "multi-level break", it appears (at least to me) that they're much more willing to just use the goto^H^H^H^Hmulti-level break instead of fixing the code. In fairness, the multi-level goto is marginally more justifiable in Java than in Ada -- Java copied all of C's biggest mistakes, including its screwed up switch/case statement. It's quite often useful to have a switch statement in a loop, and exit the loop as one of the legs of the switch -- but the screwed-up switch makes this a multi-level break. Regardless of other shortcomings I might see in its design, Ada did get its case statement right, so a single-level break suffices for this situation. -- Later, Jerry. The universe is a figment of its own imagination.