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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: 103376,4b06f8f15f01a568 X-Google-Attributes: gid103376,public X-Google-Thread: f43e6,9a0ff0bffdf63657 X-Google-Attributes: gidf43e6,public X-Google-Thread: 1108a1,9a0ff0bffdf63657 X-Google-Attributes: gid1108a1,public From: ell@access.digex.net (Ell) Subject: Re: Software landmines (was: Why C++ is successful) Date: 1998/08/20 Message-ID: <35dc6bf4.5328251@news.erols.com>#1/1 X-Deja-AN: 382820214 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> <6rf59b$2ud$1@nnrp1.dejanews.com> Content-Type: text/plain; charset=us-ascii X-Complaints-To: abuse@rcn.com X-Trace: winter.news.erols.com 903572860 606 207.172.87.139 (20 Aug 1998 00:27:40 GMT) Organization: Universe Mime-Version: 1.0 Reply-To: ell@access.digex.net Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-08-20T00:00:00+00:00 List-Id: adam@irvine.com wrote: >In article <6renh8$ga7$1@nnrp1.dejanews.com>, > ell@access.digex.net wrote: > >> 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'. >No, to me this seems to be a huge advantage of "return" over "using too many >goto's in your code that go every which way so that your code ends up looking >like spaghetti." No one is supporting the idea of using that many goto's, >the way programmers used to. Those who think goto's are OK think they should >be limited to certain specific situations, and your objection really doesn't >apply when goto's are used in that sort of careful, disciplined fashion. My point is that 'return' applies a default discipline to 'goto'. In fact it's so useful that it now becomes OK to use 'return' quite liberally. This affords much flexibility. >Of >course, "goto" can be dangerous in the hands of an inexperienced programmer; >but so, for that matter, can every other construct of every language. I'm willing to use 'goto' in time critical code where inlines are not possible, to save stack winding and unwinding. Other than that I'd rather use a procedure call and returns to get back. Elliott -- :=***=: Objective * Pre-code Modelling * Holistic :=***=: Hallmarks of the best SW Engineering "The domain object model is the foundation of OOD." Check out SW Modeller vs SW Craftite Central : www.access.digex.net/~ell Copyright 1998 Elliott. exclusive of others' writing. may be copied without permission only in the comp.* usenet and bitnet groups.