I prefer to see C++ as a failed experiment that just keeps going and going rather than garbage. The software industry learned a lot from it, both good and bad. But yea, I haven’t programmed in it since the late 1990s.
I'd phrase it differently, C++ was a set of power-to-performance trade-offs that were optimal in the 1990s.
Time has moved on.
More importantly, a typical 1990s C++ dev was likely someone who learned assembly, then C or C++. Meaning they already knew how to control hardware / memory allocation, and C++ was just a new set of abstraction tools. It was a step forward for them.
To modern devs, C++ is a step backwards. And a tough one at that.
Actually, C++ was rather poor in the 1990s if you ask me (albeit still very usable). Time has moved on - but so has the language. Its implementation tradeoffs were much better IMNSHO after 2011; but it wasn't there yet. And it still isn't! It has a lot of warts that have to stay for backwards compatibility (which is a design goal); and then, it has annoyances I can't believe are not yet addressed (like - where is my 'restrict' keyword, damn it?!)
Anyway, your view of the 1990s devs is incorrect. Almost no programmers who took up C++ learned assembly first (and few ever learned assembly). I believe most of them learned Pascal, or C, or scripting languages like Perl or Tcl or Unix shell scripts. Some may have learned Lisp or some ML variant as their first language, or Fortran 90. They didn't take a step back, they switched to a different set of language design goals and tradeoffs, and found it, well, serviceable.
It is indeed a bit peculiar that the language has had this much staying power. For C, it's much more understandable - because C is such a small and simple language (and one which, as you suggested, often feels like a bunch of syntactic sugar over PDP-7 assembly). But C++ is big, and has its baggage and warts and flaws. I think it's probably because it's been able to adapt and stretch just enough under the influence of trends in programming languages, for people not to ditch it for something new. Maybe Rust will change that; but - C++ might very well "eat its lunch".
> "because C is such a small and simple language (and one which, as you suggested, often feels like a bunch of syntactic sugar over PDP-7 assembly)."
I didn't describe such qualities of C in my previous post. At all.
And to be clear, I didn't mean "devs who learned how to program in the 1990s". I meant "devs who were active in the 1990s", which would have mostly been devs who came up in the 1970s and 1980s (where learning BASIC, then assembly was common).
I also made no claim about first languages in my previous statement. I only said there was a likely progression from assembly to C or C++ (for a C++ dev).
My point was, the talent pool in the 1990s would be able to handle the downsides of C++, and the upsides would have been a bonus. Whereas modern devs aren't used to the downsides, thus C++ is a step back for them.
What I should have added is that for devs in the 1990s, there would have been very few large legacy C++ codebases.
C++ has staying power because there was a surge in its use in the 1990s and early 2000s. Some of those people are now senior managers, who approve C++.
I'm using words using technology that would be much better built on C or lisp or smalltalk or any number of other languages. C++ is very popular because it was promoted in the right places, but is too abstract for low level tasks and too fiddly and fragile for high level tasks. It's like using a swiss army knife for construction when there's a whole box of better tools for every task.
Are you calling an entire generation of programmers idiots? Do you think they didn't know about C, Smalltalk or Lisp? C++ was the most popular language in the 90s because it was the best tool for a lot of jobs back then, people chose to use it willingly. Arguing that it only got popular because of PR is delusional, it had already gotten popular long before it got any corporation money behind it
I was part of that generation. C++ was the language that was taught in schools, and many many people were trying to get programming jobs that paid well, but they didn't really care about programming. They treated a programming language like a spoken language, and it never occurred to them how easy it was to learn another one. Many many corporate shops were C++ (or java) shops that wrote gang-of-four design pattern programs with no room for any creativity or experimentation, and a lot of that software is just designed to the moon and unnecessarily complicated. contrast that with the open source software of the time (which was more likely to be written in C then C++) and you'll see a clear quality difference.