Personally I spent enough time writing Python to acquire significant coding OCD about things like whitespace, file/directory layout, documentation. When I write C++ I have two prime directives: 1, keep it compulsively tight and legible; 2, use the idioms of C++ to sort out other peoples’ APIs (as opposed to reinventing wheels). I stick to these rules like they’re a diet, it is easy to let your mind wander and find that you’ve spent half the day writing a framework instead of solving your problem; metaphorically this is the equivalent of forgetting to go to the gym and then ordering pizza for dinner. Along these lines I give myself one premature optimization a week, like as a cheat.
I find it is most productive when you are using C++ “against” something. For example I just wrote a bunch of templates that eliminate like 90% of the requisite API boilerplate the Python C API calls for – that was simultaneously satisfying in both the “I totally solved that specific problem” and “dogg check out this clever snippet I wrote” senses of ‘satisfying’. Contrastingly, the last time I created a class hierarchy it was a sprawling regrettable mess – I am more “structure-oriented”, versus “object-oriented”, but still.
I'm sure other languages or combinations of languages will be able to supplant C++ eventually, but the combination of inertia and some of C++'s niche capabilities, plus its extensively optimized compiler support, makes C++ just a generally hard language to replace.
Yes, it's my opinion too.
C++ remains the fastest language mainly because of the compilers. That's why I still use it.
Rust is a challenger. My knowledge of it is very limited but I'm not sure if its improvements will be enough to replace C++.
I used to love C++. It was my favorite language. I still think fondly of it.
But it's come time to face facts: C++ is like that super-smart friend you knew in school, the one who was supposed to become the rocket scientist? Instead he's selling tickets to human-animal sex shows in third-world ghettos. Every time you look over there you're like "What happened?"
I feel like Obi Wan looking at Anakin "You were the chosen one! You were to bring balance to the force, not leave it in darkness!"
I'm left wondering: what happens now? Do standards committees just keep meeting and sticking more and more trinkets on the old horse because that's what standards committees are supposed to do? There's a ton of C++ code out there, and C++ was its own super-deep-dive specialty 20 years ago. Now it's a monster. Is it possible that it ever dies? And if not, do C++ experts become some kind of uber wizard in the tech community (moreso than they are now)?
It seems like something's gotta give somewhere, and beats me how that's going to play out.