comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: accessibility check failed
Date: Sun, 29 Nov 2015 15:32:25 -0700
Date: 2015-11-29T15:32:25-07:00	[thread overview]
Message-ID: <n3fu9a$h2j$1@dont-email.me> (raw)
In-Reply-To: <44e20a95-703c-4316-8dda-aa2c8d07dfb1@googlegroups.com>

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


  reply	other threads:[~2015-11-29 22:32 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-29 18:03 accessibility check failed Serge Robyns
2015-11-29 18:37 ` Jeffrey R. Carter
2015-11-29 19:00   ` Serge Robyns
2015-11-29 22:32     ` Jeffrey R. Carter [this message]
2015-11-29 22:53       ` Serge Robyns
2015-11-30  2:04         ` Jeffrey R. Carter
2015-11-30 23:22         ` Randy Brukardt
2015-12-01  9:38           ` Serge Robyns
2015-11-29 19:15 ` Dmitry A. Kazakov
2015-11-29 22:40 ` Serge Robyns
2015-12-01 20:17 ` sbelmont700
  -- strict thread matches above, loose matches on Subject: below --
2014-08-11  2:12 Accessibility " hreba
2014-08-11  5:32 ` Jeffrey Carter
2014-08-11 16:45   ` hreba
2014-08-11 16:55     ` Jeffrey Carter
2014-08-12 11:57       ` hreba
2014-08-11 19:56 ` sbelmont700
2014-08-11 20:17   ` Jeffrey Carter
2014-08-11 20:28     ` sbelmont700
2014-08-11 21:14       ` Jeffrey Carter
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox