4 ms·
Most C++ games aren't really OOP C++. They're more loosey-goosey maybe you use some OOP stuff sometimes C++. The problem is C is far too low level. And everyth
by consteval 2y ago
Most C++ games aren't really OOP C++. They're more loosey-goosey maybe you use some OOP stuff sometimes C++.
The problem is C is far too low level. And everything you can do in C, you can do in C++. You just also get things like namespaces and RAII.
From a game making perspective, there's no rules anywhere saying you have to write good, readable, C++. You can, and often people do, make amalgamations and monstrosities. You can do this very quickly, and if there's little bugs here and there it's no biggie, because you're just making a game. A segmentation fault is really not the end of the world.
- capitainenemo 2y agoWell... yes. Rust is kinda like nicer C. You can augment the data structures with behaviours. Which kyren notes in her keynote. I just feel the problem of the author of Comfy is not so much with rust-the-language but with the existing SDKs he was trying to build on which were moving targets. Not unsurprising for new stuff.
- consteval 2y agoI wouldn't describe Rust as a nicer C. Rust is a more correct C++, and C++ is a nicer C. Rust isn't actually nicer to program in than C++. It takes longer to produce the same amount of code. The tradeoff is correctness. So now the value of using Rust depends on the value of correctness. In most domains, correctness is very valuable. Game development is one in a million, where correctness really doesn't matter that much. What matters more is velocity and tooling. Even if Rust catches up with C++ in tooling and is stable, I don't believe it will replace C++ in gaming specifically. Because C++ naturally orients itself more towards that super fast development, throw-shit-at-the-wall approach to software. For gaming, that works best.
- capitainenemo 2y agoI was thinking back to the C-based dev I've done which was heavy on tying together data structures with functions that operated on them. Adding behaviours to data structures is way nicer in Rust, so that's the part that I feel would make it attractive to a C developer, in particular a game developer. ... and without the messiness of OOP inheritance in C++ messing with your convoluted game rules... (that was the main thing kyren was focusing on in that keynote) - obviously you don't have to use OOP, but your C++ frameworks probably do, and it's the natural way to do C++ and to augment your data structures with useful behaviours... if you're not doing that, you're kinda back to C-like, and at that point I feel Rust does win again...
- consteval 2y agoI mean, I just don't think this is true. All the most mature entity-component frameworks are built in C++. C++ is one of the most flexible languages, ever. OOP is a very tiny part of C++. You can 100% do data-oriented designs. And most and engines, do! > if you're not doing that, you're kinda back to C-like I don't understand how you can believe this. Maybe you don't have the C++ experience. You have higher order functions, you have templates, you have compile-time programming. Hell, C++ has higher-kinded types - even Rust's type system can't do that! C++ is very convenient to program in and very powerful. That's why it's used for games and will continue to be used for games. Rust is not more powerful, in any ways, in that regard. It can do the same shit, but with more headache. Usually that's worth it, but not for video games.