8
submitted 10 months ago by kixik@lemmy.ml to c/cpp@lemmy.ml
top 8 comments
sorted by: hot top controversial new old
[-] krnpnk@feddit.de 4 points 10 months ago

I really doubt that such a large change can come before C++ lost all its momentum. (And you could even argue that that already has happened)

I'm currently stuck at work with C++14 as we need certain compiler qualifications (for safety in automotive). Even if that proposal would be in C++26 I could maybe use it in 2035 ($current_year - 2014 + 2026). In 2035 I doubt anyone in that domain will still write C++ as Rust is already making headway.

[-] ursakhiin@beehaw.org 1 points 10 months ago

I definitely gave up on C++ when trying to refresh on it you're me too go learn C++8 before jumping in to 14.

If learning something requires learning an old version of it before moving on to the current version, something went very wrong.

[-] solrize@lemmy.ml 2 points 10 months ago

It is perfectly ok to start with C++14, in fact probably preferable to starting with anything before C++11. The idioms changed a lot in C++11. I think changes since then have been minor and incremental by comparison.

[-] ursakhiin@beehaw.org 1 points 10 months ago

Sure, today it is. In 2014, though, that wasn't the advice.

[-] solrize@lemmy.ml 2 points 10 months ago

When C++11 came out, there was an immediate feeling that the language had received a major overhaul and the best ways to do most things had completely changed. Everything from before that was legacy code, though a lot of it was around. I expect it is still mostly like that.

Or do you mean about Rust? Yes that is new. I still don't understand the attraction of Rust over Ada that well.

[-] ursakhiin@beehaw.org 1 points 10 months ago* (last edited 10 months ago)

No, I mean in 2014 the advice was not to start with the latest. Every source I found on the topic recommended getting familiar with 8 and then increment my way up to 14.

[-] solrize@lemmy.ml 1 points 10 months ago

I think the C++11 edition (whichever it was) of Stroustrup's book TC++PL suggested using C++11 immediately. That is what I would have suggested. I used C++ by necessity in a few projects before that, but I didn't start actually somewhat liking it until C++11. Everything before that was ugly legacy code.

[-] solrize@lemmy.ml 3 points 10 months ago

I don't think it's possible to make C++ safe without strictly limiting the user program to a subset of the language. There are guidelines for that (https://github.com/isocpp/CppCoreGuidelines) but even when I try to code in that style, I get to debug crashes the usual way. C++ makes some optimizations possible through e.g. move semantics that are absent from Rust and Ada but I wonder if it really matters these days. Rust seems to be displacing C++ for lots of new projects going forward.

this post was submitted on 31 Oct 2023
8 points (90.0% liked)

C & C++

843 readers
2 users here now

founded 5 years ago
MODERATORS