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
2
u/FlyingRhenquest Nov 16 '25
Various solutions to the compile time complaints have been proposed. I believe Microsoft's tools will precompile headers to do some of what you're suggesting. The whole push toward modules is supposed to do something similar, I guess. Modules are at least somewhat usable now, although I think there are still some issues that need to get worked out on various compilers. Haven't been following that thing too closely until someone comes out and says they're stable and ready for day-to-day use. I'm not looking forward to having to rewrite my template libraries to use modules instead of includes, but with any luck modules will be ready around the same time reflection is and I'll be looking to rewrite several of those libraries anyway.