r/cpp • u/Tcshaw91 • 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.
View all comments
Show parent comment
1
u/guywithknife Nov 22 '25
The point is more that you can easily not implement them by accident and in most cases you won’t actually know or be warned that you’re not implementing the correct set.
The “rule” is after all a guideline and not actually a compiler rule.
Last I checked, it doesn’t delete them, you can easily forget to write eg a destructor or copy constructor, and it will silently compile without issue, even if you probably need one (the rules say you “almost always” will need all 3/5, I suppose there are still exceptions).
I guess it does have sane defaults then, under the circumstances, but maybe it should be an error to define one and not manually mark the others as default or whatever.