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: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Teaching C/C++ from Ada perspective? Date: Sun, 08 Jul 2018 16:25:47 +0100 Organization: A noiseless patient Spider Message-ID: References: <856189aa-fa00-4960-929e-174f352310ad@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> <6acaa855-2508-49cc-a03f-16c6e00c91da@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="ecaa2e42b39b32e35bfb6320f1d6959a"; logging-data="5641"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aOWmEGtY4W82SNyWrxaLGfvdZ7Ie9DoI=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (darwin) Cancel-Lock: sha1:XFsE+Qjaj0lWCjSwCUCAng4vagk= sha1:TN3Hx7C1wyzYzxPT5dMnNxEkauI= Xref: reader02.eternal-september.org comp.lang.ada:53727 Date: 2018-07-08T16:25:47+01:00 List-Id: Maciej Sobczak writes: > 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 > dependent on P). This phenomenon is very real and proactive > application of such techniques is essential to effective physical > design. This applies to both Ada and C++. I do agree, but GNAT has become quite good about warning of "can move with to body", "useless use type" (the latter is quite annoying, GCC 8 & CE 2018 both warn on code I thought was OK, grr .. but I fix it anyway).