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

Why would anyone invest in this? I thought C++ was basically in maintenance mode given that greenfield software tends to be written in Rust...



C++ is extremely widely used. Especially since C++11, the language has received a ton of attention for making things more ergonomic. As projects update compilers, they are able to take advantage of these updates. C++ is anything but in maintenance mode.

Rust fits in a similar niche, but it has a much smaller following. Several of it's main contributors just happen to be HN regulars, so it gets more attention than it otherwise would.


> C++ is extremely widely used.

C++ is not memory safe - which is one reason why e.g. Java and C# are even more "extremely widely used" than C++. Rust is memory safe, and has C++ -like performance (and arguably better than C++, with e.g. its restriction of pointer aliasing and its high-level support for things like simple parallel programming).


Its very easy and rapidly becoming even easier to write modern c++ code that doesn't have dangling pointers/refs. The built in static analysis that Rust relies on to make its memory safety guarantees is no longer a real advantage. This type of criticism should have stayed in the 00's tbh because it really isn't true now. It's rust which will be playing catch-up to gain feature parity with c++ in the coming decade.


ooth, 99% of the C++ code out there is not using any of those "features".


A lot of C++ code bases are stuck in legacy C++03 or even earlier, for a variety of reasons. Most new code makes heavy use of standard library features such as iteratators and smart pointers.


It depends, some C++11 features are widely used, like smart pointers. I agree that most of the features are seldom used and add tons bloat to the language.


By the amount of downvotes I got you seem to be right.

I was genuinely under the impression that C/C++ was being progressively phased out in favor of Rust, but looks like this is hardly the case. I guess I should probably peek outside the HN filter bubble more often...


C++ has had major specification updates (some are smaller than others) in 2011, 2014, 2017, with a planned one in 2020. This pattern will be ongoing for the foreseeable future.

These specification changes are usually implemented by compilers _before_ the final release date. Some features take longer, but you're usually only look at 6-12 months before being able to use 100% of cutting edge.

If anything... C++ is ramping up.


I like Rust, have dabled a couple of times in it, see a possible great future for it in the next couple of decades, given that it is being adopted by the likes of Google, Microsoft, Oracle among others.

However I will keep writing C++ to go along my Java, .NET, nodejs production code, for the time being.

Rust is still lacking in IDE support, mixed language debugging, OS SDKs I generally use, integration with binary libraries, not everyone on the teams is willing to add yet another language to the mix, NVIDIA GPUs are designed for C++, and newer features make it easier to write safer code, in spite of its C underpinnings.


Rust and C++ usage are pretty much inversely proportional to their editorial frequency on HN.

Yes it looks phylosophically nice, but out of the language purist&geek, managers will not care if you are allowed or not to shoot you in the foot, they'll only care if you can deliver or not in due time.


I have not heard of a single new project being done in Rust amongst all my friends and colleagues, but I see new C++ projects cropping every few weeks.


> I thought C++ was basically in maintenance mode

You are terribly mistaken.

> given that greenfield software tends to be written in Rust...

You are terribly mistaken again.


>> > given that greenfield software tends to be written in Rust... >> You are terribly mistaken again.

True, but I sure hope that changes sooner than later. The top comment here echoes my sentiment about what C++ has become, while another one illustrates how cleanly the example can be done in Python and Rust. The problem as I see it is that long time C++ developers have learned all this arcane BS right along with its development. Anyone new to a language will vomit when they try C++ compared to Python or Rust. The C++ language developers are probably the least able to see what the problem is in this regard.

On a slight tangent, IMHO this approach to language development is at the heart of the issue that lead Guido to step down as Python lead. One of the proposals that got accepted crossed the line between readable code and "this is a compact way to do this but isn't intuitive on its face".


I learned c++ fresh two years ago. While I enjoyed learning python, I had the vomitous reaction to rust, not c++. In fact, I find modern c++ to be quite similar to python for many problems.


Do you have a link to share about that proposal? As a Python fan I'm very curious.


I assume they’re referring to PEP 572 (assignment expressions)


ScyllaDB and Seastar are good examples of modern C++ that are "greenfield" applications, and have great performance and a very good developer experience.


The truth is almost nobody uses Rust.


There is at least one order of magnitude more C++ code than Rust code, and not all projects can switch over at the drop of a hat.


I would guess at least 3 or 4 orders of magnitude.


That's much more realistic. Right now if you were to guess the number of people currently employed primarily as C++ vs Rust programmers, the difference is going to be well over 100x.

Not to mention the long history of C++. Rust has a very long way to go to catch up.


Are you new to programming? There are entire industries using only C++ for their software (like game industry)


>tends to be written in Rust.

Nobody uses Rust in production. Why such thoughts in general?


Rust is used in production by companies like Amazon, Facebook, Microsoft, Dropbox...

(Still way less than C++, of course. But we’re making big strides!)


Unfortunately a generation of developers was raised in c++ and java. The new generation writes rust fortunately so this kind of eye hurtful syntax is going away




Applications are open for YC Summer 2019

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

Search: