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

1

u/sqrtsqr Nov 23 '25 edited Nov 23 '25

Woops, I mixed together 3 and 5 and I was thinking about move not copy when I wrote that. You are right that user dtor does not delete the implicit copies. But user moves do.

"Good news" is implicit copies with user dtor has been deprecated since C++11 so every single compiler supports warnings regarding this if you enable them (and therefore errors, if you enable them)

For the meantime, I recommend all C++ programmers doing fancy classes keep a chart like the one here handy just in case. These are all over the place too and they all highlight the unexpected copies as deprecated. I even found one describing it as a "bug in the standard" which I liked.

And reviewing the chart now, I see that I misremembered a few other things as well. What a nightmare of a language. I love it so much.