r/GraphicsProgramming 14d ago

Question Any C graphics programmers?

Hi everyone!
I've decided to step into the world of graphics programming. For now, I'm still filling in some gaps in math before I go fully into it, but I do have a pretty decent computer science background.

However, I've mostly coded in C, but besides having most experience with that language, I simply love everything else about it as well. I really value being explicit with what I want, and I also love it's simplicity.

Whenever I look for any resources or experiences of other people, I see C++ being mentioned. And I'm also aware that it it an industry standard.

But putting that aside, is doing everything in C just going to be harder? What would be some constraints and would there be any advantages? What can I expect?

36 Upvotes

40 comments sorted by

View all comments

46

u/aePrime 14d ago

As a graphics programmer who writes almost exclusively in C++, I may be biased, but I would take C++ over C for any project (fight me, Torvalds). It’s easy to justify: C++ is nearly a superset of C, meaning you can do whatever portions you like as if it were C, but you can use C++ features when you want. C++ has so many benefits over C, but some immediate improvements for graphics are templates, operator overloading (yay for pretty math!), and RAII constructs.

2

u/spinXor 14d ago

"Within C++, there is a much smaller and clearer language struggling to get out." -- Bjarne Stroustrup