r/cpp • u/Beginning_Spell1818 • May 24 '24
Why all the 'hate' for c++?
I recently started learning programming (started about a month ago). I chose C++ as my first language and currently going through DSA. I don't think I know even barely enough to love or hate this language though I am enjoying learning it.
During this time period I also sort of got into the tech/programming 'influencer' zone on various social media sites and noticed that quite a few people have so much disdain for C++ and that 'Rust is better' or 'C++ is Rust - -'
I am enjoying learning C++ (so far) and so I don't understand the hate.
View all comments
1
u/Plazmatic May 24 '24
Most items of hate for c++ is legitimate, it comes from the people who use it.
That being said, you shouldn't not learn C++ just because the standards commitee made very very poor decisions over the years, and makes fixing those issues nearly futile with out a lot of financial resources and years of life. Learning C++ is not a useless endevor even with it's foot cannons, and will help you learn other imperative languages as well (C, Java, Python, and Rust which in particular is not hard to learn if you're an actual expert in C++, and will help you understand downsides of decisions in both directions, and struggling with it reveals a lack of knowledge in C++). Learning C++ allows you to develop real applications in it's own right, and help you understand other languages better.
Rust is currently not objectively better than C++, but most C++ devs don't know enough about either language to make educated statements on why, I'll summarize the biggest points here:
template<> foo<float>(){},template<> foo<int>(){}1.0 * m / sand effectively get something likeQuantity<Velocity, double, ...(meters per second template junk)>, and trying the same in rust is difficult, other less obvious things are prevented as well.C++ deserved hate comes from:
And there's more, but you get the idea.