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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a24:b045:: with SMTP id b5-v6mr6511602itj.35.1530604826241; Tue, 03 Jul 2018 01:00:26 -0700 (PDT) X-Received: by 2002:aca:eb15:: with SMTP id j21-v6mr2999798oih.6.1530604825991; Tue, 03 Jul 2018 01:00:25 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!news.linkpendium.com!news.linkpendium.com!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!d7-v6no409242itj.0!news-out.google.com!z3-v6ni535iti.0!nntp.google.com!u78-v6no417042itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 3 Jul 2018 01:00:25 -0700 (PDT) In-Reply-To: <3701bf07-89a5-4cb0-a704-5aebb589ca79@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=194.9.244.34; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S NNTP-Posting-Host: 194.9.244.34 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> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <2f5e4ce0-94e8-4b94-9da7-045ec90a9b22@googlegroups.com> Subject: Re: Teaching C/C++ from Ada perspective? From: Maciej Sobczak Injection-Date: Tue, 03 Jul 2018 08:00:26 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader02.eternal-september.org comp.lang.ada:53522 Date: 2018-07-03T01:00:25-07:00 List-Id: > And I quote from you below [...] Of these, only your unspecified allusion= to Pimpl Actually, I didn't even have this idiom in mind (so again, don't put what I= did not say in my mouth). I meant the general concept of having specificat= ions and (possibly partitioned) implementations as separate physical artifa= cts. These concepts, at this general level, are shared and are common to bo= th Ada and C++. BTw - Pimpl solves a different problem (physical dependencies) and, interes= tingly, that problem exists in Ada as well. There is nothing that C++ lacks= in this area when compared to Ada. > Then in that paragraph, you switch to the negative Because this was not the only reply in this thread. Others already suggeste= d what to do and some of this I disagree with. I have listed traps to avoid= . > but never positively telling the OP what to actually teach Wrong. Most of my post was a list of what to teach. Stop trolling, it's too= cheap. > The OP is yearning for: what portion of accesses and pools and subpools He did not mention any of these in his question. That is, you are accusing = me of saying things that I did not say, in reply to what OP did not ask abo= ut. It's a very poor trolling. > can be brought over from Ada's wise memory management The wise part of the memory management in Ada is that most of it need not b= e explicit. This is what makes Ada and C++ different from, say, Java, as bo= th Ada and C++ are value-oriented instead of being reference-oriented. This= is what I meant by saying that pointers can be avoided for a very long tim= e.=20 > That next paragraph is repeatedly telling OP what /not/ to do Right. I stand by what I wrote. He should /not/ do what I have mentioned an= d I am fully aware that this opinion is not in line with what was already w= ritten in other replies. > Negativity and embrace-the-pure-tried-&-true-party-line-C++-way was not w= hat OP was requesting. The OP asked what to do in order not to waste his time (did you read his po= st, actually? if not, do it now). And this is exactly what have I recommend= ed. > Overtly declaring the range of integers over which this portion of code o= perates can be a key portion of eliminating all variants of the overflow/ov= errun vuln(erabilitie)s that worms utilize as their attack vector to insert= machine code. I think you are having communication troubles. I have written: "don't confu= se them with range-checked arrays". > But never mind SEI software engineering principles, eh? So can you kindly point me to where exactly SEI recommends defining integer= range types in C++? They have a whole set of recommendations for C++. Can = you point me to the right place, please? My recommendation to OP was not to waste time. Please don't troll me, I don= 't want to waste mine, either. > Here are some libraries for [...] Yes. There are libraries for just about everything. But in the spirit of no= t wasting time (again, that's what OP asked for), don't show them all to st= udents in the beginner course. They will find them later if they need them,= but there is no reason to obstruct the presentation during the course that= is devoted to algorithms (again, see what OP was asking about). > Yeah right, C++ programmers haven't been yearning for Ada's strong typing= on those =E2=80=9Cgazillion of incompatible types=E2=80=9D, eh? This is what I did some 12 years ago: https://archive.is/9AmoJ And I will repeat: Do Not Do This. Don't troll. Don't put words into others' mouths. Read very carefully what = you reply to. Let's keep this group a quality discussion place that it alwa= ys was. --=20 Maciej Sobczak * http://www.inspirel.com