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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,81bb2ce65a3240c3 X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.232.42 with SMTP id tl10mr6268987pbc.7.1335454114538; Thu, 26 Apr 2012 08:28:34 -0700 (PDT) Path: r9ni101045pbh.0!nntp.google.com!news2.google.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: What would you like in Ada202X? Date: Thu, 26 Apr 2012 08:28:33 -0700 (PDT) Organization: http://groups.google.com Message-ID: <32785308.1758.1335454114085.JavaMail.geo-discussion-forums@yniw15> References: <3637793.35.1335340026327.JavaMail.geo-discussion-forums@ynfi5> <31103380.3735.1335377235157.JavaMail.geo-discussion-forums@vbuo17> <26317529.742.1335381313996.JavaMail.geo-discussion-forums@ynje10> <17572718.3572.1335384748259.JavaMail.geo-discussion-forums@vbbfk16> <30695328.1199.1335386401806.JavaMail.geo-discussion-forums@yndm3> <86r4vb0whn.fsf@gaheris.avalon.lan> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 X-Trace: posting.google.com 1335454114 23274 127.0.0.1 (26 Apr 2012 15:28:34 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 26 Apr 2012 15:28:34 +0000 (UTC) In-Reply-To: <86r4vb0whn.fsf@gaheris.avalon.lan> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Date: 2012-04-26T08:28:33-07:00 List-Id: On Thursday, April 26, 2012 12:43:00 AM UTC-7, Mart van de Wege wrote: > Adam Beneschan writes: >=20 > > On Wednesday, April 25, 2012 1:12:28 PM UTC-7, > > okel...@users.sourceforge.net wrote: > >> On Wednesday, April 25, 2012 9:15:13 PM UTC+2, Adam Beneschan wrote: > >> > And why would having a "continue" statement be better than the > >> > workaround? > >> Conciseness, plus avoidance of gratuitous "goto" (banned by various > >> coding guidelines) > > > > This is the sort of thing that makes me want to cry. There's a reason > > "goto" is banned from some coding guidelines, and it's not because one > > day Dijkstra came down from a mountain with a slab that said "Thou > > shalt not use goto". It's banned because in most cases, using it > > negatively impacts readability and (as Jeff said) there's almost > > always a better way. I've tried to argue here that using "continue" > > is worse for readability than using a "goto" in this case--so if I'm > > right, it would make no sense to have coding guidelines that disallow > > "goto" and allow "continue". Of course, if you're able to argue that > > the "continue" is more readable in this case, please do so. But I > > suspect that's not possible if ... > > > Hmm. >=20 > I like the Perl use of 'next' and 'last' to influence looping. >=20 > Especially when looping over a list of values, it is nice to test for > values you don't want to process at the start of the loop, and > immediately go to the next iteration. >=20 > The canonical example is processing a file with comment lines starting > with '#': >=20 > while (<$file>) { > next if /^#/; # skip comment lines > [...Do stuff with line ...] > } OK, I'll have to admit that I do stuff like this when I use Perl. On the o= ther hand, the mere fact that I've decided to write something in Perl indic= ates that I don't care about readability for that particular program. I'd = rather not have Ada head in the same direction. Plus, I think this is OK i= n a small loop (maybe a dozen lines) that could be mentally "eaten in one b= ite". -- Adam