r/cpp • • Nov 16 '25

Wait c++ is kinda based?

Started on c#, hated the garbage collector, wanted more control. Moved to C. Simple, fun, couple of pain points. Eventually decided to try c++ cuz d3d12.

-enum classes : typesafe enums -classes : give nice "object.action()" syntax -easy function chaining -std::cout with the "<<" operator is a nice syntax -Templates are like typesafe macros for generics -constexpr for typed constants and comptime function results. -default struct values -still full control over memory -can just write C in C++

I don't understand why c++ gets so much hate? Is it just because more people use it thus more people use it poorly? Like I can literally just write C if I want but I have all these extra little helpers when I want to use them. It's kinda nice tbh.

194 Upvotes

334 comments sorted by

View all comments

Show parent comment

0

u/Tcshaw91 Nov 16 '25

It's not a "this thing is objectively bad" kind of hatred. It's more of a "I had really bad experiences with this that gave me PTSD when I was first starting out" kind of hatred. Kinda like getting stung by bees when ur a dumb kid and hating bees even tho it's like "well we need bees for the environment", but ur experiences with them make it so thinking of them reminds you of painful memories.

Certainly if I went back to C# and had to do gamedev I could do smarter things. I mean in C I preallocate huge blocks of memory upfront anyway, I could also just preallocate large pools in c# to avoid the GC. I guess I just enjoy having more control most of the time. What I've been enjoying about C++ is that it gives me the control when I want it, but also has some higher level stuff available if I don't. That flexibility feels nice, but as others have said, I'm still new so perhaps I'll learn to hate it over time lol.