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: 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: doylep@ecf.toronto.edu (Patrick Doyle) Subject: Re: Software landmines (loops) Date: 1998/09/08 Message-ID: #1/1 X-Deja-AN: 389083856 X-Nntp-Posting-Host: spark19.ecf Sender: news@ecf.toronto.edu (News Administrator) References: <35F534F6.D3CCE360@sprintmail.com> Organization: University of Toronto, Engineering Computing Facility Newsgroups: comp.lang.eiffel,comp.object,comp.software-eng,comp.lang.ada Date: 1998-09-08T00:00:00+00:00 List-Id: In article , wrote: >In article <35F534F6.D3CCE360@sprintmail.com>, >John G. Volan wrote: >> >>As you can see, the nesting has been considerably reduced, yet this >>function is still single entry/single exit. It also shares with the >>early-return version the advantage of showing the choice of error-code >>close to the test that determines the error. >> >>Best of both worlds? :-) > >Yes, but this was my point. Many people rail against early returns >as being "problematic" for whatever reason or purpose. To my mind, >provided you restrict early returns to 'pre-condition checking', the >logic can still be preserved, and can be just as "readable" (or indeed >"unreadable") as a se/se solution. [*] Yes but, unless I'm mistaken, that was *John's* point: His code contained no early returns, and still preserved se/se without deep nesting. -PD -- -- Patrick Doyle doylep@ecf.toronto.edu