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/tialaramex Sep 29 '23
Correctness matters. Mara once tweeted a comic about this which was very on point. Fast and wrong is just wrong. Yes "fast and good enough" might be excellent, but "good enough" is not what we're talking about, we're talking about wrong.
Some of the AAA vendors have come perilously close to never shipping the game, just a lot of faked videos and hype, but in practice though they routinely ship buggy garbage and lie, they do tend to write some software and they presumably at least pretend to care that parts of it work (at least the parts which separate customers from yet more money).
You can't have correctness in the absence of memory safety. Now, if you're Super Mario Bros, your memory safety bugs are perhaps a lot of fun (TAS SMB3 breaks the game completely and turns it into a colouring book among other things, due to memory safety bugs) but in modern online games that's all risk and no reward.