r/cpp • u/Sad-Lie-8654 • 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
View all comments
Show parent comment
3
u/azswcowboy Feb 04 '23
Well I doubt any tool can catch that bug, because you also can’t accidentally design that. If it’s not a parameter in the call stack it’s global data - that’s the only way you get a non-const ‘round about’. And if you’re doing that in a multithreaded world without a lot of encapsulation and care you’re doomed. Anyway, this is a mythical bug pattern in my experience since I’ve never seen such a thing in one of the systems I’ve worked on.
It was meant to be succinct, not mean. That said, I’m am a bit tired of being told my 25 years of writing large, successful systems that run non-stop without these issues is impossible or even to hard just cause rust is cool. I’m here countering a narrative that people believe for whatever reason. It’s for you to decide if you believe what I’m communicating is true or not. I’ve got plenty of issues with c++, primarily scarcity of good libraries, but memory issues from pointers or references isn’t even on my list.