The one thing I really regret is listening to the kind of opinionated people that will tell how a certain popular language is bad and you shouldn't use it.
Twenty years ago when I learned Python, people told me it was a waste of time. Sure it is a nice language but you will never get a job doing it.
When I got into PHP ten years ago people told me it is a horrible language and basically dead already. Still, PHP was key to my career and I am making good money programming with in in 2025.
I used to be a C++ hater because that was the cool thing to do. Then I tried Unreal Engine and had to use C++ and discovered it is... fine. Really. There is a good reason it is heavily used in the gaming industry. I don't totally love it. The compile times are kind of annoying but C++ is not the only language suffering from that. If you need the performance and the ecosystem, C++ still isn't the worst choice.
The most used Desktop projects were started before 2015, around which new languages were stable enough to consider app building. Those apps fill their niche well and people don't need to start new projects for these niches, and new developers add to those projects instead of replacing them, which is a good thing. The cloud, AI, mobile (or crypto ..) by example are another story.
Part of the answer is in term C/C++ itself. C is a very popular language because the history around Unix and FFI. C++ builds on that popularity by being sort of backwards compatible with it and being what Microsoft Visual C++ supports if you want more languages features beyond ISO C90. Which brings to mind another factor, that people used to pay for compilers and IDEs. The hobbyist had to consider price as well as functionality, portability, performance and popularity in what programming languages they choose. Given there were several C++ compilers to choose from and the popularity of Windows it makes sense that C++ won.
Why has nothing replaced it? That depends on what you mean by replaced. Python, and Typescript/JavaScript have replaced it in many places. It's just low level programming where C++ has yet to be superceded. For that kind of programming there had not been many that could even approach the space until LLVM-based languages started coming out recently.
Some things come down to the OS system. We're still using the C FFI and other system elements designed around C. So until something better replaces those we're still using C on some level.
Long term stability is pretty important and C/C++ has a pretty good record of that. A lot of the bad press is also for ideological reasons, not entirely practical ones.
Finally, I think it's because the C/C++ manages to stay hidden. You don't need to know that it's written in C/C++ to use it.
With all of the unpopular press that they get, why has history often proven C/C++ to be the right choice time and time again?