comp.lang.ada
 help / color / mirror / Atom feed
From: "Jeffrey R. Carter" <spam.jrcarter.not@spam.not.acm.org>
Subject: Re: Full view of a private partial view cannot be a subtype
Date: Tue, 5 Dec 2017 19:40:38 +0100
Date: 2017-12-05T19:40:38+01:00	[thread overview]
Message-ID: <p06p76$rd$1@dont-email.me> (raw)
In-Reply-To: <c6fef139-6718-4c05-8791-897e995bdb4c@googlegroups.com>

On 12/05/2017 01:35 PM, Jere wrote:
> 
> You run into the same issues with composition (only in my view worse).  With
> composition you still have to look up each component's file to see it's
> operations and worse yet you have no tools that can help you extrapolate
> what operations are available from a higher level component.  With extension
> you can at least use auto completion lists to see what all the options are.
> With composition you are stuck doing X.<see list> then X.Y.<see list> then
> X.Y.Z.<see list> and so on.  Then the component chaining when wanting to call
> an ancestor's operation can quickly blow up with composition (as opposed to
> extension where there is a single level).  You can simplify this by creating
> forwarding functions in the higher level components, but that is analogous
> to adding overloads in the higher level components for extension.  For either
> it is optional.

If you're lucky enough to have such a tool. I still find myself reading code 
without such assistance often enough that I think that code that is only 
readable with a tool is not readable at all.

But your argument is about ease of writing, with isn't going to convince anyone 
who likes Ada. Ada explicitly states in the ARM Introduction that it's for code 
that's easy to read, not easy to write. The fact that you type more with 
composition is not an argument against it.

But in my design a client wouldn't have X.Y.Z... It would apply an operation to 
a variant record X and the operation would do the correct thing for the current 
variant. If you needed to find the actual code executed without a tool, there's 
a chain of with clauses to lead you to it. You don't end up looking at an 
abstract subprogram with no idea where the actual subprogram is.

> I respect yall's view on this, but in either case it is still a subjective
> matter.  There are a variety of people out there who all view things very
> differently.

I disagree. There are a set of S/W-engineering principles that help guide the 
S/W engineer to create S/W that is simple, correct, and easy to read. Every 
real-world use of type extension that I've seen has violated the principle of 
locality--that's inherent in the nature of type extension. Thus it is 
objectively more complex and harder to read than S/W that violates none of the 
principles.

-- 
Jeff Carter
"I did not rob a bank. If I'd robbed a bank, everything
would be great. I tried to rob a bank, is what happened,
and they got me."
Take the Money and Run
139


  reply	other threads:[~2017-12-05 18:40 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-03  2:14 Full view of a private partial view cannot be a subtype Jere
2017-12-03 12:01 ` Jeffrey R. Carter
2017-12-03 13:33   ` Jere
2017-12-03 14:34     ` Jeffrey R. Carter
2017-12-03 17:44       ` Robert Eachus
2017-12-03 18:50         ` Simon Wright
2017-12-03 22:10           ` Robert Eachus
2017-12-03 19:03         ` Jeffrey R. Carter
2017-12-03 22:23       ` Jere
2017-12-04  8:25         ` Dmitry A. Kazakov
2017-12-04 18:04         ` Jeffrey R. Carter
2017-12-04 20:41           ` Jere
2017-12-04 21:48             ` Jeffrey R. Carter
2017-12-05  8:20               ` Dmitry A. Kazakov
2017-12-05 18:16                 ` Jeffrey R. Carter
2017-12-05 20:39                   ` Dmitry A. Kazakov
2017-12-05 21:38                     ` Jeffrey R. Carter
2017-12-05 12:35               ` Jere
2017-12-05 18:40                 ` Jeffrey R. Carter [this message]
2017-12-06 12:54                   ` Jere
2017-12-06 18:03                     ` Jeffrey R. Carter
2017-12-05 20:22                 ` Randy Brukardt
2017-12-05 15:27               ` Shark8
2017-12-05 18:50                 ` Jeffrey R. Carter
2017-12-05 20:59                 ` Randy Brukardt
2017-12-05 22:43                   ` Shark8
2017-12-07  0:52                     ` Randy Brukardt
2017-12-05 20:16               ` Randy Brukardt
2017-12-05 21:29                 ` Jeffrey R. Carter
2017-12-07  0:04                   ` Randy Brukardt
2017-12-04 20:49 ` Randy Brukardt
2017-12-05 12:56   ` Jere
2017-12-05 20:12     ` Randy Brukardt
2017-12-17 15:26       ` Jere
2017-12-17 15:39         ` Dmitry A. Kazakov
2017-12-18 22:47           ` Randy Brukardt
2017-12-19  1:22             ` Jere
2017-12-19 23:16               ` Randy Brukardt
2017-12-19  1:01           ` Jere
2017-12-19  9:08             ` Dmitry A. Kazakov
2017-12-19 13:08               ` Jere
2017-12-19 13:27                 ` Dmitry A. Kazakov
2017-12-19 19:10             ` Stephen Leake
2017-12-18 20:45 ` Stephen Leake
2017-12-18 22:54   ` Randy Brukardt
2017-12-19  1:08   ` Jere
replies disabled

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