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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a37:e40b:: with SMTP id y11mr11964606qkf.88.1560754489343; Sun, 16 Jun 2019 23:54:49 -0700 (PDT) X-Received: by 2002:a05:6830:1086:: with SMTP id y6mr12007270oto.22.1560754489021; Sun, 16 Jun 2019 23:54:49 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.uzoreto.com!feeder1.cambriumusenet.nl!feed.tweak.nl!209.85.160.216.MISMATCH!j96no3789221qte.0!news-out.google.com!e10ni382qtb.1!nntp.google.com!j96no3789210qte.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 16 Jun 2019 23:54:48 -0700 (PDT) In-Reply-To: <9dcf22a2-2255-4089-b1f0-93e31448415e@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=176.11.243.33; posting-account=uulyKwoAAAA86DO0ODu--rZtbje8Sytn NNTP-Posting-Host: 176.11.243.33 References: <728c4668-8fa0-4a57-a502-2bf476fc3940@googlegroups.com> <4908c3e3-18dc-4953-bf26-46f160d2ebfd@googlegroups.com> <9dcf22a2-2255-4089-b1f0-93e31448415e@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <797c8c6d-5f74-469d-951d-0cbbc8005792@googlegroups.com> Subject: Re: Latest suggestion for 202x From: Egil H H Injection-Date: Mon, 17 Jun 2019 06:54:49 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56656 Date: 2019-06-16T23:54:48-07:00 List-Id: On Sunday, June 16, 2019 at 6:54:30 PM UTC+2, Maciej Sobczak wrote: > > An array can be easily swapped for a function without requiring major c= hanges all over the place, as array indexing and function calls have the sa= me syntax. >=20 > A(I) :=3D 7; >=20 > Swap(A(I), A(J)); >=20 > Sort_Subarray(A(1..10)); >=20 > ... >=20 > Not really. >=20 > Arrays are *not* exchangeable with function calls. Maybe not 100%, but that doesn't mean it's not a useful feature. I've certa= inly had use for it on more than one occasion. It also works the other way = around; if your algorithm inside a function is measured to have sub-par per= formance, it's easy to exchange it for a pre-calculated lookup-table. > Therefore, the fact that they have similar syntax is more a source for co= nfusion than any genuine advantage.=20 I don't find it confusing. Having a similar syntax just makes everything co= me together in a very nice fashion that feels familiar and aesthetically pl= easing to the eyes, i.e. readable. > Also, the bracketing used is different from any other popular programming= language, which further adds to confusion.=20 Well, we don't want to repeat the mistakes of others :p > Also, it cannot be easily found by text-based tools without complete sema= ntic capability (grep, etc.). There's often more than one array in my codebase... Even within one file th= ere can be both definition and usage of more than one array. So grep-ing fo= r square brackets can give hundreds of false positives. I would much rather= just grep for the type name of the actual array I'm interested in. --=20 ~egilhh