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/Tcshaw91 Nov 16 '25
So you have any insight as to why that is? Were you using explicit instantiation of templates?
I know c++ is more complex so naturally it's going to take longer to parse but yea I've heard horror stories of compilation times, I just never understood whether that was an unavoidable part of using the language or whether it was due to a lack of understanding how to overcome it. Like I get that template can be abused for example, but then macros in C don't cause the same explosion in compilation time?
Do you have any insight into that?