Hacker News new | ask | show | jobs
by wtetzner 2103 days ago
> The _only_ factor to programming language popularity is how accessible it is.

> Beauty and elegance don't matter. Performance doesn't matter. In fact, no measure of "fitness for purpose" matters.

If that were true, C++ wouldn't be so popular.

4 comments

C++ was very much more accessible than the alternatives (mostly Turbo Pascal) in the late 90s. As devs started moving to unix it became the most accessible option in the landscape (not counting C, which I would argue is in a different market) with djgpp, g++, etc.
Yeah, I think a better approach would be to state that a language popularity is determined by how much it makes you think that you can do useful things with it (even if it's a mistaken perception). Accessibility is pretty related, but this kinda explains C++ better, as it was "the language" used for all "serious" and "high performant" software, and therefore seen as the way to go for a lot of people. It was also what was used in a lot of other software you had to interact with, so in a sense that made it more accessible too: if you had to use it anyway, why not just stick with it all the way.
The popularity of C++ took off at a time when its competition was C. Not modern C, but C89 and older. Oceans of ink have been spilled describing the quality-of-life improvements that early C++ made over contemporary C. It is only with hindsight that we see how flawed these improvements were, and how other languages might achieve them with more elegance (and fewer corner cases that constantly explode in your face).
C++ is relatively easy to code in a plain way that don't blow up in your face. It's just that java made much more business sense with GC, stack trace, safe objects and built-in security model.
> It is only with hindsight that we see how flawed these improvements were

I think some platforms existed that had already solved those issues, but it was a different time. Disseminating those ideas was harder, open source wasn't as much of a thing yet, so development was siloed, we didn't have blogs or youtube to aggregate and broadcast the danger of those footguns, and it was the evolutionary solution that did provide the most QOL improvements.

I agree. C++ offers a fairly good compromise between performance, low-level control and convenience. C++ strings and vectors, classes, make it much easier to implement a number of things in C++ than in C. The popularity of C++ is very much a matter of fitness for purpose.

You could write code in D or Nim, and your code might be marginally more readable, but you wouldn't have as many easily available libraries, or as much support (eg: stack overflow). It's hard to compete with the fairly good compromise that C++ offers.