Hacker News new | past | comments | ask | show | jobs | submit login

C++ is here for longer than your career will last. Outside of HN/Web bubbles it's still used everywhere. Chances are you're writing this message on a C/C++ OS running a C/C++ browser engine. NodeJS and v8 are C++ applications.

I went to a lecture by Stroustrup once who was asked what he thought of Java and jokingly said he didn't like to be negative about C++ applications. While this is a joke and Java isn't actually written in C++ (anymore?), it's good to remember the majority of the stack under yours is probably in it.




> Chances are you're writing this message on a C/C++ OS running a C/C++ browser engine. NodeJS and v8 are C++ applications.

That's because there was hardly any mainstream alternatives (sans C, I guess) within its domains (ie systems programming and related field) until recently. That's not to say people haven't wished for alternatives. God knows I have


I've only worked in tech for a decade but I remember seeing this back then, and can find articles two decades ago about the same thing. There's just so much code in C++ that can't be re-written or can be re-written but will take hundreds of developer years. For example Rust doesn't even have a spec. I don't think I could use Rust for regulated healthcare/defense fields? There's not really that much support in hardware for Rust in robotics. If something works in banking why risk moving to Rust? Etc... I think Rust has a place but right now I'd wager a C++ code base is worked on way after the last Rust code base has been created.


Right, you're absolutely correct that C++ is currently the defacto standard (or maybe not even just defacto) in those fields.

I have a lot of opinions on the situation. Some are on technical merits, some boil down to humans doing human things.

It's difficult for me to give C++ much credit on that front due to the fact it's had such an incredibly long head start and tremendous amount of effort put into it. Similar efforts exist for Rust now, but they're only starting.

Maybe something better than Rust comes along eventually too. I'm not married to Rust. That doesn't mean I'll want Rust to fail or disappear. It just means there will be more choices.

I'm just not going to let my tools hold me back. Same goes for the C++ and Rust situation currently.

Also, it's possible that it's just a quirk of preference. Some people prefer mangoes to pineapple, some are the opposite.


There have been a million things hyped as alternatives, and even though it is very easy to argue retrospectively that they were not really alternatives, they definitely were hyped as much or even more than e.g. Rust is hyped these days.

think Java and Go. I have already _lived_ an era where I thought C++ would eventually be replaced with Java and I would have to learn Java (this was so long ago). The effect was so pervasive that e.g. universities started teaching Java instead of C as their introductory language. Why would anyone want to manage memory manually, ever again? Benchmarks were showing Java as beating C++ in some algorithms, and theoretical papers appeared about how some kind of programs are much easier to optimize for JIT VMs than classical compilers. Everyone thought it was just a matter of time until classical compiled languages were irrelevant. Even in the embedded space (and Java made significant inroads). The effect was so big I was actually convinced to start up learning Java ... only for C++ to eventually prevail over Java.

The last time this happened was with Go. Every single week there would be an article here in HN about Go this and Go that, or how Google is rewritting their C/C++ codebases into Go. Turns out, they did not. You then start to hear retroactive justifications about how Go was actually a "services" language instead of a C replacement (despite the fact it was literally sold as a C replacement made by the creators of C itself no less).

Nowadays we get articles about Google rewriting their codebases into Rust.


> only for C++ to eventually prevail over Java

What? Java dominates C++ in number of professional programmers. It totally ate C++'s lunch. Meanwhile, universities teach Java, C, Python, and a bit of Scheme if they're feeling spicy.


Look, I'm not saying C++ will go away. I agree with you the whole "X will be the Y killer" arguments are nonsense.

I used to like C++, and just don't care about it any more. It can stay, and I'm sure it makes people happy to use it if that's all they know. It's just that it mostly made me miserable—even though I reached for it for years.

Right now people have more choices, some of which you mentioned. Is Go a better choice than C++ for some projects? Absolutely! Can it be worse? Absolutely! Theses things depend on so many things.

Same goes for Java, and Rust, and TypeScript, Haskell.

The whole "C++ can do everything those languages can do" is just a nonsensical argument. C can do everything C++ can, so what? I can come up with more ludicrous examples of that statement too.

Tl;Dr if C++ tickles someone the right way: I'm happy for them to use it. But shunning any conversation about PL advancements because alternatives have them and C++ doesn't is immature and unproductive.


> Look, I'm not saying C++ will go away.

No one is saying that . C++ will obviously never go away, the same way that APL will never go away. But what is questioned here is whether it will actually be a _relevant_ skill in future times to come.

To simply say "it will be yet another tool!" is just a value-less assertion.

> But shunning any conversation about PL advancements because alternatives have them and C++ doesn't is immature and unproductive.

Who is doing that, either?

My personal opinion is that the language who eventually becomes most relevant will be the one with the _fewest_ PL advancements, and that will be a sad thing, but is life as usual. Or what was popularly considered a PL advancement last decade will just be seen as a side step in the next. Again, the usual...


> > But shunning any conversation about PL advancements because alternatives have them and C++ doesn't is immature and unproductive. > > Who is doing that, either?

Unfortunately many. You can even see these comments on HN.

Sometimes people even get angry over the whole RIIR stuff, or if Rust gets introduced into a codebase, and the project moves away from C++. It's like they ignore the listed reasonings the maintainer explained completely.

Or when people speak about memory safety people pivot it into a general security conversation, ignoring the merits of the borrowing system.

If you speak of the benefits of Rust enums (or Algebraic data types in general sometimes, sadly) it gets called "glorified tagged enums" (or syntactic sugar for them).

People saying "well boost has a library for that" and talking about beast asio to compare it to Rust async, etc.

Or saying C++ can do have the same or similar value ownerships semantic through shared_ptr/unique_ptr when that's simply not true.

Or when people say "well standard library uses unsafe" (without even knowing what "unsafe" in Rust means, I might add)

Uh there's so many other misconstructions or misconceptions that I've seen, but I don't go around collecting them so I can't really remember more from the top of my head.

Look at the Chromium discussion when the devs decided to introduce Rust, or the recent Fish shell announcement, or when Linux decided to add Rust. Full of "but C++..." shills who haven't even contributed to the projects

> My personal opinion is that the language who eventually becomes most relevant will be the one with the _fewest_ PL advancements, and that will be a sad thing, but is life as usual. Or what was popularly considered a PL advancement last decade will just be seen as a side step in the next. Again, the usual...

I disagree because I think nature (and humans) seek to reduce the amount of energy spent on activities for desired outcomes. Ie, we want to optimise the process, and we are lazy. Rust saves me mental and emotional energy. Since changing jobs (from C++ to Rust) by burnout has been recovering and I'm feeling more energised after work too. And the current job is arguably more straining as it has more responsibility. I don't think Rust is quite there yet either, but it feels like a step in the right direction.


> C++ is here for longer than your career will last.

How many C++ jobs are there currently compared to, for example, NodeJS? 1000:1? 10,000:1? I have no idea, but I do know that there are very, very few c++ opportunities in the midwest.

As in engineering, careers are about trade-offs: we can go deep into a tech to make us very qualified for a narrow sub-set of jobs; or we can go broad and be less qualified for a wider selection of jobs. I've decided that broad, shallow skills are more useful than deep, narrow skill sets.

I think the poor availability of C++ jobs is what keeps people from focusing on it as a career, and I was providing a personal anecdote to express that idea. While the software I'm using to write this message may be written in C++, the company who owns the software I'm using to write this message isn't going to hire me.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: