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!news.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: accessibility check failed Date: Sun, 29 Nov 2015 15:32:25 -0700 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <3d45e3ed-16ca-4018-bf7b-62830acaca03@googlegroups.com> <44e20a95-703c-4316-8dda-aa2c8d07dfb1@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Injection-Date: Sun, 29 Nov 2015 22:30:04 -0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="caa759af2a9c666aec02942f6fe5abd6"; logging-data="17491"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19Q5HDxXCbfBctpIp/H/6SnffCUlAI8p/s=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 In-Reply-To: <44e20a95-703c-4316-8dda-aa2c8d07dfb1@googlegroups.com> X-Mozilla-News-Host: news://freenews.netfront.net Cancel-Lock: sha1:Es2aU/GMC5ZErFEZUKA7fPfUOrU= Xref: news.eternal-september.org comp.lang.ada:28598 Date: 2015-11-29T15:32:25-07:00 List-Id: On 11/29/2015 12:00 PM, Serge Robyns wrote: > On Sunday, 29 November 2015 19:37:07 UTC+1, Jeffrey R. Carter wrote: >> If you avoid both programming by extension and anonymous access-to-object types >> your code will be simpler, clearer, and you will avoid mysterious error msgs. >> >> If you further follow the design rule of no public access types things will be >> even better. > > I'm trying to understand if this is a sarcastic comment or a genuine advise? It's quite genuine. The most common problems posted on here of the "Why am I getting this msg?" or "Why doesn't this do what it should?" sort relate to anonymous access types and programming by extension. I conclude that they were mistakes and should not have been added to the language. My aversion to programming by extension goes back to the early 1990s when it was proposed for Ada 9X. I experimented with the proposals and found that it makes code harder to read than equivalent code without it. Access types are notoriously error-prone, so any necessary use of them should be hidden as deeply as possible (and given the unbounded containers, there are very few necessary uses). Using public access types and foisting what should be hidden onto the clients of the pkgs in which they appear may make them easier to write, but harder to use, and increases errors in the overall program. Avoiding public access types is a design rule I follow scrupulously. -- Jeff Carter "Ah, go away or I'll kill ya." Never Give a Sucker an Even Break 100