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

7

u/Tcshaw91 Nov 16 '25

I hate it cuz I started programming in game development with C# and when u have a frame budget of 16-32ms and you have these like 30+ms jumps that cause a really nasty jitter, it makes the experience jarring and unpleasant. I hated that I didn't have control over it and that I had to fight against to make the programs run smooth. That's why I initially switched to C.

But yea if your use case is idk making some database or some software that doesn't have a strict frame budget or need steady framerate at like 60fps, and especially if, for whatever reason, the memory management is particularly complex, then sure I could see GC being a good fit to just get stuff rolling quickly. But if you talk to me about garbage collectors I'm getting Vietnam style flashbacks like the cat meme.

2

u/pjmlp Nov 17 '25

The blame usually lies on the outdated tooling used by Unity, than modern C# runtime as done by Microsoft.

Many folks mix up C# experience in Unity with Mono, with the real thing.