What are we supposed to do, cancel our subscription to C++? Complain to the CEO of C++?
What are we supposed to do, cancel our subscription to C++? Complain to the CEO of C++?
What I'm genuinely interested in, is why is this such a big deal for me, but apparently not for other people? What copes do people employ to get over it to enable themselves to write C++? Per my initial question: why (and how) do people put up with it?
Especially when modern and powerful alternatives exist which have mostly either learned from the mistakes of C++, or avoided them altogether.
1. I use a small amount of the surface area of C++, so the parts I don't use don't bother me
2. I may have silent footguns all over my code, but if I run my CMake build, and the tests pass, and the application does what I need from it, I really don't care
3. The up-front cost of writing correct/no-footgun code using Rust (as just one example) for me is much worse than the fluid "anything goes" of C++
>What copes do people employ to get over it to enable themselves to write C++?
C++ is powerful, flexible, and ubiquitous. Many third-party libaries in my daily toolbox are in C++, and I can re-use my code on Android, WebAssembly, cli applications, and any kind of project I may need to deploy. C++ skills are more widely available, such that maintaining C++ code is easier for companies (hiring employees, contractors, etc.) Delivering C++ code has me access to more clients and projects.
I can finish a C++ audio project for a client faster than I can figure out a `Ref<Arc<&'a static mut`, and they're happier for it.
That said, I don't start new projects in C++ mainly because of the header/source split. After writing a lot of code in languages that don't require a header file, I believe that C/C++ not making headers files redundant in 90s itself has been a costly mistake. Think of the time wasted because of constantly having to sync header/source files. One can argue that it does not take much time but it is hard to estimate how many bugs might be introduced because of such busywork breaking mental flow.
Oddly, real problems like these are never brought in these "C++ sucks" discussions.
The reason to use c++ is for low level performance, but it's not 2005, you can now get the same performance with modern languages that give increased safety, developer velocity, readability, maintainability, and more.