SamSuka
jdh
jdh

patreon


New video! 4 months of game programming

a new video appears! Here's the whole thing as an exclusive patron preview :)

Comments

That's amazing work! I've always admired the good old gaming times where people were creating the foundation of what we play now - no standards, no frameworks, no rules - just masterpieces from scratch! All this gets me nostalgic. I follow you and your work with lots of love and respect!

Mihail Dimitrov

I don't think C++ would necessarily incur a performance hit, but there can definitely be unforeseen runtime overhead especially with any std:: things whose internals you don't really have control over. C++ can also optimize better for some cases, notably with sorting algorithms where template specialization (instead of function pointers) can allow for inlining of comparison/copy functions for better performance. My preference for C mostly comes out of its simplicity - C++, especially the way that most people are taught to write it, tends to hide a lot of details with RAII/destructors/operator overloading/etc. that can make it hard to follow program control flow whereas the limited feature set of C tends to lead to more readable/"followable" code. Where it counts though, generally, C and C++ are going to have basically the same performance with the same code, with a couple of tiny exceptions here and there. but I don't think the minuscule performance difference is worth everything else incurred by C++.

jdh

P.S: I have not looked at C++ code in about 10 years, but I still have some understanding of the runtime overhead associated with object related memory allocation and runtime binding in C++. It would seem that implementing this program in C++ would result in a noticeable performance hit. So I was hoping you could comment on your experience with the two languages. When I think about it now, I can see how it might be 'easier' to stick with C as opposed to learning about the numerous C++ performance optimizations while also coming back up to speed with C++.

D Brown


More Creators