From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail From: John McCabe <"john@nospam.mccabe.org.uk"> Newsgroups: comp.lang.ada Subject: Re: Ada and "early return" - opinion/practice question Date: Tue, 16 Mar 2021 08:38:05 -0000 (UTC) Organization: A noiseless patient Spider Message-ID: References: <38356aa9-b8b0-4e0b-a490-99e7b239d0b1n@googlegroups.com> <86eegge32o.fsf@stephe-leake.org> <077ed5ef-61c9-4178-a21c-e0955d5da12fn@googlegroups.com> <87mtv4utk0.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Tue, 16 Mar 2021 08:38:05 -0000 (UTC) Injection-Info: reader02.eternal-september.org; posting-host="e18ab550129ff764d5cf1e3494dd6cd3"; logging-data="21224"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fX51l8ggUKFVyDMH6oQip9E/dI6spLdI=" User-Agent: PhoNews/3.4.0 (Android/8.1.0) Cancel-Lock: sha1:pMuTFPwKkpnRBeurSBjQfPFy2+k= In-Reply-To: <87mtv4utk0.fsf@nightsong.com> Xref: reader02.eternal-september.org comp.lang.ada:61548 List-Id: On 15/03/2021 19:05, Paul Rubin wrote: >John McCabe writes: >> In recent months, where I've been learning more and more about the ins >> and outs of "modern c++", I'm becoming more and more inclined to ditch >> it and use something where the language designers appear to want to >> address issues in a way that's consistent and relevant to their users' >> needs, rather than just fannying around to try to prove how clever >> they are. > >It's a real improvement over old c++ despite the hacky stuff they had to >do to get it to work in the general framework of C++. The notoriously >clumsy template error messages should improve some with the use of the >c++20 constraints (aka concepts) feature: > >https://en.cppreference.com/w/cpp/language/constraints > >The book "Effective Modern C++" by Scott Meyer is very good, but is a >few years old (C++17 or so, iirc) and doesn't include this newest stuff. > >This also helps: > >https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md I've been using Modern C++ for 3 and a half years now. Yes, there are some improvements, but even many of them seem like, as you say, hacky stuff, partly because a lot of the additional functionality is not core language changes, they're additions to the standard library (many based on Boost), yet Boost remains indispensable (especially if you want to be sure that condition_variable::wait_for() will use the steady_clock and not the system_clock - depending on the compiler you need to use). I almost daily find myself finding some new feature then being disappointed because they haven't done the whole job. enum class, e.g. was a hugely missed opportunity, and CTAD is great, until you want to use std::make_shared with it. There just doesn't seem to be the same rigour in C++ updates that was obvious in Ada language changes. However, I imagine someone has already discussed all this in depth so I don't really want to go over all that stuff. -- Best Regards