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=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: stopping a loop iteration without exiting it Date: Sat, 6 Jan 2018 10:59:45 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <81971548-23c9-4927-a6a8-6f0f1dba896b@googlegroups.com> <867esx70lw.fsf@gaheris.avalon.lan> <86373k74qh.fsf@gaheris.avalon.lan> <87shbki0et.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 6 Jan 2018 09:59:45 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="b6cb98f9beb8b17aca944719a16aeeb4"; logging-data="739"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/91shdYNq6ogxggFpkGRyRdb+yy3GFxE0=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: <87shbki0et.fsf@nightsong.com> Content-Language: en-US Cancel-Lock: sha1:4ak6C9UGvDY419PkqZaoYWbNF70= Xref: reader02.eternal-september.org comp.lang.ada:49783 Date: 2018-01-06T10:59:45+01:00 List-Id: On 01/05/2018 08:13 PM, Paul Rubin wrote: > > If a construct is useful, then the existence of an ugly workaround for > its absence doesn't make it non-useful. Of course it's not "needed"; as > Mart van de Wege says, you could use GOTO for everything so none of it > is needed. The question is whether it improves code readability, > reliability, developer productivity, etc. When I say "needed", I of course mean needed to make the code significantly simpler or clearer than code without the "continue". In fact, my experience has been the opposite: excluding the majority of uses, which are equivalent to an "if" and are equivalent in simplicity and clearness, the real-world examples I've seen where people wanted or used a "continue" were simpler and clearer when reworked to avoid the "continue". I'm willing to accept that there are cases where the construct would result in simpler or clearer code. People have claimed to have such cases, but I have not seen them. But based on my experience, there is no need for such a feature. -- Jeff Carter "What's the amount of the insult?" Never Give a Sucker an Even Break 104