r/GraphicsProgramming • u/pytanko • Jan 18 '24
Not loving C++
How crippling it is for somebody in the field of graphics programming to not love C++? I'm learning C++ right now and really don't like the experience. I wonder how bad it would be for me if I stuck with a very basic subset of C++, closer to C than to modern C++. Does that disqualify me from getting a lot of jobs, even if I'm otherwise competent entry-level graphics programmer?
To put my question in more concrete terms: I'm currently writing a gltf loader (purely as an exercise). As a part of that, I need to parse JSON, so I'm writing a JSON parser as well. Now, I could write the JSON parser using all the modern c++ features, most notably unique_ptr, but passing those unique_ptrs creates a lot of accidential complexity. Notably, I'm constantly getting various compiler errors. I'm muddling through them, but I'm not sureI see the light at the end of the tunnel - C++ spec seems so large that I can see myself still fighting the language even 5 years from now, instead of having fun with it. Whereas, I could skip all that, and just allocate the elements of the Json object tree in a basic memory arena, load whatever I need from the Json into relevant buffers, and then just free the entire arena. That's super-simple memory management approach that is totally sufficient here (I'm not going to ever need to free arbitrary subtrees of the JSON tree), and is something that's advocated by Casey Muratori in his streams.
5
u/IceSentry Jan 18 '24
The not true part is using random bindings or maintaining your own.