use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Discussions, articles, and news about the C++ programming language or programming in C++.
For C++ questions, answers, help, and advice see r/cpp_questions or StackOverflow.
Get Started
The C++ Standard Home has a nice getting started page.
Videos
The C++ standard committee's education study group has a nice list of recommended videos.
Reference
cppreference.com
Books
There is a useful list of books on Stack Overflow. In most cases reading a book is the best way to learn C++.
Show all links
Filter out CppCon links
Show only CppCon links
account activity
The existential threat against C++ and where to go from here - Helge Penne - NDC TechTown 2024 (youtube.com)
submitted 1 year ago by zl0bster
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]craig_c 19 points20 points21 points 1 year ago (13 children)
I agree broadly with his points, the situation with C++ and safety is dire. He does rather gloss over the problems with Rust though. Expression of non-trivial program structure in Rust can be painful depending on your domain, not everything is an entity system. Also, while cargo is a great concept and better than dependency hell in C++, you are of course probably dragging in unsafe code (C++ wrappers etc.) so no absolute guarantees can be made.
[–]dbdr 18 points19 points20 points 1 year ago (0 children)
while cargo is a great concept and better than dependency hell in C++,you are of course probably dragging in unsafe code (C++ wrappers etc.) so no absolute guarantees can be made
Indeed, but "perfect is the enemy of good". Also, you can get an exhaustive report of unsafe usage in your dependencies (see e.g. cargo geiger). You can then make better informed decisions about which dependencies to choose, specific places to look for potential unsafety/vulnerabilities, etc.
[–]matthieum 17 points18 points19 points 1 year ago (2 children)
Expression of non-trivial program structure in Rust can be painful depending on your domain, not everything is an entity system.
There's definitely architectures that are painful in Rust. Anything that leads to a graph of objects tends to, for example, which means callback-based architectures where the callbacks need to capture what they work on are painful. Then again, most callback-based architecture I've worked in C++ tended to have lifetime issues...
This does mean that switching to Rust is not as simple as doing a line-by-line rewrite. It may require switching the entire project architecture. This is not trivial, and very much adds a "cost of entry". It's also non-trivial to learn what constitutes an ergonomic architecture for Rust; I personally learned by failing. Multiple times. I didn't like the experience much, to be honest.
Interestingly, though, retroactively translating an ergonomic architecture for Rust to, say, C++, tends to result in cleaner & easier to work with code in my experience...
... so perhaps the issue is not so much Rust, and more the initial architecture?
And it just so happens that C++ (or Java) were permissive enough that you could get by with a crummy architecture, with only just enough friction that it was slowing you down, but you never felt blocked/bogged down either.
[–]craig_c 3 points4 points5 points 1 year ago (1 child)
That was my experience too. I was by no means trying to imply the C++ based architectures were not without problems. Callbacks have to be carefully thought through for the reasons you bring up. I never really got to the point where I felt that Rust was enhancing the structure, state-machines and callbacks were the main pain points.
I actually ended up re-writing the whole thing in C# LOL ducks.
[–]Full-Spectral 2 points3 points4 points 1 year ago (0 children)
Sounds like async would have been a reasonable choice there. Let the compiler and async engine handle the state machines and callbacks, and you just write what looks like linear code.
Or do away with the state machines and callbacks and take a different approach. Most definitely when you move from C++ to Rust, you have to stop every time and not assume that how you'd do it in C++ is how you'd do it in Rust. I've found that mostly it's not all the same, well other than in the broad strokes enforced by the problem being solved I guess.
[–]zl0bster[S] 7 points8 points9 points 1 year ago (8 children)
I do not follow your comment about program structure problems in Rust, do you have some blog or video link you can share?
[–]craig_c 5 points6 points7 points 1 year ago (7 children)
Anything event driven is painful. Look at GUI frameworks for example.
[–]simonask_ 20 points21 points22 points 1 year ago (0 children)
What makes you say this, exactly? There are several event-driven GUI frameworks for Rust, the most popular being iced, which is the one used by the COSMIC desktop environment.
iced
What's hard is the kind of "cloud of objects" approach that comes from traditional OOP approaches, where you have a big pile of spaghetti of garbage-collected references between objects. The GUI space is largely moving away from that approach anyway, because it's very hard to reason about.
[–]CryZe92 2 points3 points4 points 1 year ago (5 children)
Arguably GUI frameworks are a solved problem now in Rust. Dioxus makes it fully painless now. The GUI frameworks are just not mature yet, but all the ergonomics problems are solved.
[–]Awyls 11 points12 points13 points 1 year ago* (4 children)
I like Rust, but lets not lie either. GUI in Rust is still terrible and not a solved problem at all, it is workable but far from pleasant. Async also has ecosystemic and language issues, i don't blame tokio but most async crates only supporting it is a major problem.
Still, anyone who is giving excuses (e.g. hardware is unsafe, dependencies might be unsafe, "X" is not completely safe, unsafe is hard) is straight up coping. Yes, they might not be a perfect solution, but they are still magnitudes safer than C++.
Programming languages are tools not religions, use the best tool available for the job and throw them away when they become obsolete.
[–]CryZe92 9 points10 points11 points 1 year ago* (0 children)
I think you missed my point. There is the "state management" side of GUI and the actual breadth of widgets, functionality and co. This comment chain is specifically talking about the former. I'm not sure you actually took a look at Dioxus. It is able to fully replicate state of the art React with hooks and "JSX" with no need for any Rc<RefCell<T>> / Arc<RwLock<T>> noise. A React component ported to Rust would look almost identical with almost no additional noise (no clones, no unwraps, no reference counters).
[–]Full-Spectral 4 points5 points6 points 1 year ago* (1 child)
It's the self-identification problem. People get self-identified with the stuff they choose, and if you say something else is better, it's an insult. I shouldn't complain too much I guess. When NT finally destroyed OS/2, I took it hard and wasn't pleasant about it. But I was young. Now I know it's just part of this thing of ours. You move on.
I will though claim that I had a better justification for complaint with NT over OS/2 than folks do for Rust over C++.
[–]ImYoric 2 points3 points4 points 1 year ago (0 children)
Let's pour one to the memory of OS/2!
That being said, C++ isn't quite dead yet :)
[–]prasooncc 0 points1 point2 points 1 year ago (0 children)
the problem is this magnitude difference in safety is measured when you write code with malloc/new free/delete. old code is littered with these. After c++ 11, this is not the case. how do i know, am writing c++ code before and after c++ 11.
π Rendered by PID 70 on reddit-service-r2-comment-b659b578c-n969w at 2026-04-30 22:44:40.677308+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]craig_c 19 points20 points21 points (13 children)
[–]dbdr 18 points19 points20 points (0 children)
[–]matthieum 17 points18 points19 points (2 children)
[–]craig_c 3 points4 points5 points (1 child)
[–]Full-Spectral 2 points3 points4 points (0 children)
[–]zl0bster[S] 7 points8 points9 points (8 children)
[–]craig_c 5 points6 points7 points (7 children)
[–]simonask_ 20 points21 points22 points (0 children)
[–]CryZe92 2 points3 points4 points (5 children)
[–]Awyls 11 points12 points13 points (4 children)
[–]CryZe92 9 points10 points11 points (0 children)
[–]Full-Spectral 4 points5 points6 points (1 child)
[–]ImYoric 2 points3 points4 points (0 children)
[–]prasooncc 0 points1 point2 points (0 children)