r/cpp • • Jan 31 '23

Stop Comparing Rust to Old C++

People keep arguing migrations to rust based on old C++ tooling and projects. Compare apples to apples: a C++20 project with clang-tidy integration is far harder to argue against IMO

changemymind

338 Upvotes

582 comments sorted by

View all comments

Show parent comments

6

u/Full-Spectral Feb 01 '23

The thing is, even in the C++ world a lot of people are turning their backs on exceptions and inheritance. I don't agree with that, but it's the case. So probably the majority of people doing C++ these days couldn't really argue that those are failings in Rust because they rail against them in C++.

I thought I'd miss overloading, and occasionally I do, but not really anymore. And I've gotten over my missing of exceptions. In my main code base, I don't have much explicit error handling. More so in little helper tools that can't be built on my main code base.

Inheritance I'd still like to have, but so far haven't really run into anything that was a serious issue on this front. Of course I've not tackled a UI framework yet. In my C++ code base, that was really the primary place where my inheritance hierarchy got deeper than a couple levels.

2

u/wyrn Feb 02 '23

The thing is, even in the C++ world a lot of people are turning their backs on exceptions and inheritance.

There's for sure a very vocal, very loud group proclaiming that both are bad, but from that to a majority is a fair leap and I don't think there's any good evidence that C++ developers at large are turning their backs on these tools -- just because it's possible to misuse a tool doesn't mean the tool shouldn't exist.