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.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: Charles Hixson Subject: Re: Software landmines (was: Why C++ is successful) Date: 1998/08/19 Message-ID: <35DAF56C.80031495@earthling.net>#1/1 X-Deja-AN: 382688898 Content-Transfer-Encoding: 7bit References: <6qfhri$gs7$1@nnrp1.dejanews.com> <35cb8058.645630787@news.ne.mediaone.net> <902934874.2099.0.nnrp-10.c246a717@news.demon.co.uk> <6r1glm$bvh$1@nnrp1.dejanews.com> <6r9f8h$jtm$1@nnrp1.dejanews.com> <6renh8$ga7$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii Organization: http://extra.newsguy.com Mime-Version: 1.0 Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-08-19T00:00:00+00:00 List-Id: That is the same as the argument for break and continue. A good one I feel. It is true that, as was written earlier, break and continue are always(?) implemented as-if they were goto statements, nevertheless because of their restricted compass (either the immediate block, or a named enclosing block) they do not impair code readability to the same extent as the goto does. As a famous man once said "GoTo considered harmful to programming". It has been years since I used a language so crippled that I choose an algorithm construction that required a goto to properly implement it. Please note that that is a two-part statement, partially language design and partially algorithm choice. Ada is not such a crippled language, as "exit when" is a perfectly adequate loop-leaving method. (I'm not sure what Ada has that corresponds to continue, but that is a less frequently needed choice). ell@access.digex.net wrote: > > In article <6r9f8h$jtm$1@nnrp1.dejanews.com>, > dennison@telepath.com wrote: > > In article , > > dewar@merv.cs.nyu.edu (Robert Dewar) wrote: > > > T.E.D says > > > > > > But it's a toss up in this case, and for most purposes we would prefer > > > the second case. Where it gets tricky is > > > > > > for J in 1 .. N loop > > > if condition 1 then > > > ... > > > if condition 2 then > > > ... > > > if conditoin 3 then > > > goto Continue; > > > > > > Now T.E.D's prescription is not so clear, and we end up having to > > > severely contort things, or introduce a boolean flag which we keep > > > testing as we unwind to the end. > > > > > > Remember that the continue here is just like a return. If you are allergic > > > to using a loop continue or exit, you should be allergic to using a return > > > (other than at the end of a function). Some people are, and that is at > > > least consistent. But I see a lot of Ada programmers who will use a return > > > without hesitation from a nested loop, but still turn green at the sight > > > of a goto. That makes no sense to me. > > A 'return', at least in C/C++/VB, returns you to the place the current > procedure was called from. 'goto' control flow can be endlessly channeled > here and there and never has to return to where the initial linear control > flow was originally diverted. That seems to be a huge advantage of 'return' > over 'goto'. > > Elliott > > -----== Posted via Deja News, The Leader in Internet Discussion ==----- > http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum -- Charles Hixson charleshixson@earthling.net (510) 464-7733 or chixso@mtc.dst.ca.us