▲ | landdate 4 days ago | ||||||||||||||||
I don't understand the hate towards C++. Many of the aspects criticized for are non-issues in modern C++. I am not to knowledgable about Rust, but what reason is there to use Rust? Memory safety isn't much of a problem in C++ anymore with smart pointers, std::move. Implicit typing exists in C++ with std::auto. Functional programming with lambda, std::functional, std::map, etc. C++ does everything I have wanted it to do, has a huge ecosystem of libraries, and great tools. | |||||||||||||||||
▲ | lII1lIlI11ll 4 days ago | parent | next [-] | ||||||||||||||||
> Memory safety isn't much of a problem in C++ anymore with smart pointers, std::move. Of course it is! You can still access an object after std::moving it somewhere, return references to local stack variables from functions, double-delete (or zero!), use uninitiated variables and do bunch of other things that rightfully caused notoriety C++ has got. And am saying it as someone who writes C++ every workday, unfortunately. | |||||||||||||||||
| |||||||||||||||||
▲ | thegrim33 4 days ago | parent | prev | next [-] | ||||||||||||||||
This'll be an "out there" comment but after coming to the conclusion long ago that governments have infrastructure built to manipulate online communities with mass propaganda, usually to impart typical political/social messaging, and then realizing that a few years ago the NSA put out an official statement about wanting people to not use C++, I finally put two and two together and realized that, being a government entity, they could have easily just tacked on an "anti-C++" campaign to the list of active propaganda farm campaigns, and viola, anti-C++ comments start appearing on forums everywhere. | |||||||||||||||||
▲ | saidinesh5 4 days ago | parent | prev [-] | ||||||||||||||||
The issue with modern c++ is ecosystem. It is still full of legacy c++ libraries. Even though people have mostly settled on cmake, it's still common to run into friction when integrating third-party libraries. Nothing as streamlined as cargo. Vcpkg, hunter, conan, vendoring in libraries etc... Don't get me wrong. Number of C++ libraries is far bigger than number of rust libraries. But number of modern c++ libraries is still not that high i feel. So once you have integrated legacy code into your project, there's a lot of scope for newbies to create memory leaks/double free/etc ... | |||||||||||||||||
|