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!feeder.eternal-september.org!aioe.org!.POSTED.fn3LatRFkm9/xzEj7F2/NQ.user.gioia.aioe.org!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Why .ads as well as .adb? Date: Wed, 5 Jun 2019 14:48:23 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <28facad3-c55f-4ef2-8ef8-004925b7d1f1@googlegroups.com> <89abdd73-28ff-46ec-b77e-b8324d496d9c@googlegroups.com> NNTP-Posting-Host: fn3LatRFkm9/xzEj7F2/NQ.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 X-Notice: Filtered by postfilter v. 0.9.2 Content-Language: en-US Xref: reader01.eternal-september.org comp.lang.ada:56485 Date: 2019-06-05T14:48:23+02:00 List-Id: On 2019-06-05 11:04, Maciej Sobczak wrote: >>> So what exactly cannot be deduced? >> >> The class. > > What if I don't need the virtual "class" and I'm interested in the single instance only? The one that I wrote? > I'd argue this is the most frequent case. Class in mathematical sense, a set of certain structure. As for singleton class yes, it represents itself. But that is extremely rare and unrealistic. Would you never wanted to change anything? Once you urged to change anything then you do not have it singleton. You have some set of implementations (class) and some constant part for the clients (interface). >>> Please provide some challenging example. >> >> Let x be 1. Deduce the set it belongs to. >> >> procedure Foo is >> begin >> X := 1; -- What are the type of X, 1, >> end Foo; > > This is not a complete code, exactly because the type of X is not known. Yes, the specification is missing. > But if you declare X so that it is visible where Foo is, then the information is complete and the spec can be generated (which also means it's not needed). You want to me to write the specification down, so that you could "deduce" it? That proves my point. You cannot deduce the specification: generic X : in out Integer; procedure Foo; > For example - how would your example look in Java? No I idea. I am making a universal point. Whatever language it is, you want to limit effects of code modification and to support cooperative developing process, you must distinguish specifications and implementations on many different levels, not only on the level of compilation units. Information hiding, abstraction, reuse, generic programming etc just follow. >> To make programmer's life a bit easier? > > Isn't it the most important purpose of having programming languages at all? > Do you want to convince me that the purpose of Ada is to make the programmer's life more difficult? Then, I can tell you, there are countless numbers of beginners who are already convinced that this is actually the case. I don't object. Beginners have different understanding of what software design process is and what helps the process and what does not. Their understanding is naturally all wrong, otherwise they would not be beginners. >> That does not change anything in the nature of declarations. They are >> semantically separate and the programming language should keep this >> distinction clear. > > But we still don't know why it should do it. Common sense? >> You mean I have that much influence on designers of C/C++ software > > If you are designing C/C++ software, then I hope so. > > I disagree with your argument that in Ada one can have separate *.adb files for different platforms, whereas in C++ one uses #ifdefs. This is just wrong. Once I reviewed C code which had everything in a single header file. Why not? It is quite logical if following your logic... >> You are asking religious questions, why people keep on doing bad things? > > (Lack of) Education might be the answer. > > But note that lack of education is also the reason for people to stay unaware of Ada. So we have a choice: educate people to write good C++ or educate people to write Ada. It is no choice, because the worse a language is less efficient education becomes. Resources of brain are limited. Each language irregularity, unsafe choice etc plays against us. > But choice is a burden. Right? :-) Absolutely! Since Google, Facebook et all are already at doing censorship and suppressing freedom of speech, they could to do a great service to the humankind by eradicating "hate" code written in "offensive" [programming] languages... (:-)) -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de