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,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fac41,9a0ff0bffdf63657 X-Google-Attributes: gidfac41,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: ell@access.digex.net Subject: Re: Software landmines (was: Why C++ is successful) Date: 1998/08/19 Message-ID: <6renh8$ga7$1@nnrp1.dejanews.com>#1/1 X-Deja-AN: 382635968 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> Organization: Deja News - The Leader in Internet Discussion X-Article-Creation-Date: Wed Aug 19 14:30:00 1998 GMT Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada X-Http-User-Agent: Mozilla/3.04 (WinNT; I) Date: 1998-08-19T00:00:00+00:00 List-Id: 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