2 ms·
I see this sentiment all the time and the answer is "nooooo." It's honestly getting frustrating, and I tire of writing the same apologia. No C++ isn't unproduc
by banachtarski 9y ago
I see this sentiment all the time and the answer is "nooooo." It's honestly getting frustrating, and I tire of writing the same apologia.
No C++ isn't unproductive. Go and C# is NOT FAST OR SUITABLE FOR GAME DEV (AAA in particular but even lighter games. You'll pry manual memory management from me from my cold dead hands). Maybe you mention C# because it "powers" Unity? Guess what, it compiles to C++ through the IL backend. Other languages haven't figured out cross-platform. And I don't mean Mac and PC. I mean Mac, PC, iPhone, Android, Linux, Playstation, Xbox, etc. People keep writing about C++'s demise, but I don't see them writing LCP constraint solvers in other languages successfully. I will submit that of the things you mentioned, Rust and Nim are closer to the target since, at least, they don't run on this slow as molasses runtime (slow in game terms), but they are extreeeeeeemely immature, and you're talking on porting very complex problems. No thanks, I'll take the thing that has an actual standards committee where I can determine exactly how to control or tweak things at whim.
Basically, this type of comment is always a cheap shot to get upvotes but simultaneously always misinformed and from someone without actual game development experience.
- pjmlp 9y agoJust like C++ used to be compiled to C. There are many valid uses for C++, however using IL2CPP as an example, well that is just an implementation detail of their C# compiler. If Unity would be willing to spend the money, they could have implemented a compiler backed instead.
- banachtarski 9y agoThe usage of a GC changes the nature of the solution entirely. Say you wanted to write a bullet hell game. Spawning bullets/spells in the thousands takes pretty careful management and without memory management, understanding where you've leaked or why memory isn't being reclaimed when you expect can be nightmarish.
- pjmlp 9y agoSame applies to malloc()/new, no one on their right mind would be allocating during the hot path of rendering loop. With GC languages, one just needs to learn about value and reference types, and which language features might implicitly allocate. Which can be helped via static analysis. Regarding .NET specifically, there are quite a few ways of doing manual memory management, although not as fine grained as C++, which many devs seem to be completely unaware of. In both scenarios, using a profiler is a must have for anyone caring about performance. And lets be real, unless one is competing with AAA level games, there is a big spectrum of game styles that don't need the ultimate hardware performance, just good enough for an enjoyable game experience.
- steveklabnik 9y agoIncidentally, apparently getting Rust running on consoles is fairly easy, see https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_kyren_from_chucklefish_we_make_and/ https://www.reddit.com/r/rust/comments/78bowa/hey_this_is_ky... This is of course, far from the ease of official vendor support.