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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Received: by 2002:a6b:6d05:: with SMTP id a5-v6mr4939730iod.16.1530908533279; Fri, 06 Jul 2018 13:22:13 -0700 (PDT) X-Received: by 2002:aca:4787:: with SMTP id u129-v6mr2511116oia.4.1530908532936; Fri, 06 Jul 2018 13:22:12 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!border1.nntp.ams1.giganews.com!border2.nntp.ams1.giganews.com!nntp.giganews.com!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed9.news.xs4all.nl!85.12.16.69.MISMATCH!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer02.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!d7-v6no3928186itj.0!news-out.google.com!l67-v6ni4171itl.0!nntp.google.com!g2-v6no853629itf.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 6 Jul 2018 13:22:12 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=213.108.152.51; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 213.108.152.51 References: <856189aa-fa00-4960-929e-174f352310ad@googlegroups.com> <2718c8d4-5f35-4fd8-a1aa-1e60069a7a5d@googlegroups.com> <39fce60c-9f56-42fb-b679-fa08810b00ee@googlegroups.com> <3701bf07-89a5-4cb0-a704-5aebb589ca79@googlegroups.com> <2f5e4ce0-94e8-4b94-9da7-045ec90a9b22@googlegroups.com> <18554067-1382-4b43-a832-2d27aa5117d7@googlegroups.com> <8dc19505-b68a-403c-a164-f1de1864f3f1@googlegroups.com> <559657f8-bbf4-4a70-9449-f85bc98d6c6b@googlegroups.com> <590d4672-4aef-42a5-823c-57ccd291115a@googlegroups.com> <8de6b5ba-25ab-4d46-b80c-1544f43a9b05@googlegroups.com> <670baa25-a987-45a0-991f-ec3aa2878233@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <6acaa855-2508-49cc-a03f-16c6e00c91da@googlegroups.com> Subject: Re: Teaching C/C++ from Ada perspective? From: Maciej Sobczak Injection-Date: Fri, 06 Jul 2018 20:22:13 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Received-Bytes: 3988 X-Received-Body-CRC: 636131637 Xref: reader02.eternal-september.org comp.lang.ada:53706 Date: 2018-07-06T13:22:12-07:00 List-Id: > But I'll say that examples involving empty packages and useless withs don= 't=20 > really prove anything regardless of the language involved Fair point. > - they're not very=20 > realistic. Empty packages are not, but useless withs quite well reflect the rotting of= the codebase during its evolution and refactoring. The whole pimpl idiom (= as it is known in the C++ community, but practiced in Ada, too, under the "= opaque pointer" name) exists exactly to reduce the number of compile-time d= ependencies. In the case of my previous example, if you find a way to move = the useless "with P" from the Q's spec to its body, then you can gain a lot= in terms of this reduction (in particular, Test becomes no longer dependen= t on P). This phenomenon is very real and proactive application of such tec= hniques is essential to effective physical design. This applies to both Ada= and C++. > I'd suggest looking at examples of privacy (which Ada is very=20 > strict about) and comparing to other languages (which I don't know well= =20 > enough to do myself). Good point, but here I will argue that Ada does not have any recognizable a= dded value with regard to C++ - that is, I think I am able to translate any= typical Ada privacy structure into equivalent C++ definitions. What is int= eresting in this area, however, is that in large projects I can actually ex= pect that the privacy policies will be intentionally (!) reduced, for examp= le with unit testing and run-time inspection in mind. Yes, it is possible t= o avoid this, but it is costly and the cheaper option wins. This observatio= n applies to all static languages. --=20 Maciej Sobczak * http://www.inspirel.com