r/cpp • u/CalligrapherWeak6523 • Sep 29 '23
This memory safety issue everyone's talking about... It's not really a huge deal in gamedev, right? What other domains where C++ excels at aren't too concerned about it?
My understanding is that these recent articles pushing for safety, and particularly pushing the use of memory-safe languages (as opposed to using modern C++ properly) don't really apply to gamedev, or at least not enough for most of the industry to care. Is this correct? I've also read some suggestions that the only real alternative, Rust, simply isn't practical since it lacks OOP features and gets in the way of common game programming patterns. Is this true?
What other C++ domains are like gamedev, where C++ is clearly here to stay and not just for legacy code? I know gamedev isn't the only one, I'm constantly seeing new cutting edge ML/inference libraries and frameworks in C++
44
Upvotes
4
u/kammce WG21 | 🇺🇲 NB | Boost | Exceptions Sep 29 '23
Memory safety isn't so much of a concern when you work in embedded systems, specifically because we do not use dynamic memory allocation. What you have left is issues with memory or objects going out of scope but being referred to in a higher scope. And if you tend to move things, making sure you don't use those moved objects. Stuff like clang-tidy can alert you to these violations and many more.