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!.POSTED!not-for-mail From: "Jeffrey R. Carter" Newsgroups: comp.lang.ada Subject: Re: Full view of a private partial view cannot be a subtype Date: Tue, 5 Dec 2017 19:40:38 +0100 Organization: Also freenews.netfront.net; news.tornevall.net; news.eternal-september.org Message-ID: References: <889a3aed-4e6b-49c8-8c1c-6f1478e8e077@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 5 Dec 2017 18:40:38 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="ddd03d8240ed4b3c78267063e548869a"; logging-data="877"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/p5mdkJylSrAOHg/Rbu68oXD/+4GSJilg=" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 In-Reply-To: Content-Language: en-US Cancel-Lock: sha1:V2SQUOJ77EnMWsU1+ndT820gkQY= Xref: reader02.eternal-september.org comp.lang.ada:49380 Date: 2017-12-05T19:40:38+01:00 List-Id: 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. then X.Y. then > X.Y.Z. 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