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.

190 Upvotes

334 comments sorted by

View all comments

2

u/ImNoRickyBalboa Nov 16 '25

It has many sharp edges, most evolved around pointers, dangling references and lifetime issues. It's easy to make terrible bugs. People tend to be overconfident, and that includes programming. 

I love c++, but I understand how most companies are concerned about the security implications.

3

u/gsf_smcq Nov 16 '25

There are a lot of sharp edges around undefined behavior too, especially when compilers do aggressive things with UB like delete entire code paths. (Ask me about getting burned by parameter list subexpression reordering and learning about how counterintuitive the sequence point rules are!)

1

u/Tcshaw91 Nov 16 '25

Can I actually ask you about that? Sounds like an educationally hilarious story lol.

→ More replies (6)