logoalt Hacker News

einpoklumyesterday at 10:06 PM2 repliesview on HN

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".


Replies

scjtoday at 1:09 AM

> "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.

kazinatoryesterday at 11:13 PM

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++.

show 1 reply