News for hackers. Stuff that matters.
Re:C++20 Ranges by war1025 on Saturday December 22, 2018 @05:28PM (#18742851)
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.

Re:C++20 Ranges by zozbot123 on Sunday December 23, 2018 @07:31AM (#18745731)
> 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).

Re:C++20 Ranges by mikeloomis on Sunday December 23, 2018 @10:19AM (#18746516)
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.
Re:C++20 Ranges by alacombe on Saturday December 22, 2018 @06:23PM (#18743078)
ooth, 99% of the C++ code out there is not using any of those "features".
Re:C++20 Ranges by saagarjha on Saturday December 22, 2018 @09:48PM (#18744096)
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.
Re:C++20 Ranges by jefft255 on Saturday December 22, 2018 @06:46PM (#18743222)
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.
Re:C++20 Ranges by aaaaaaaaaab on Saturday December 22, 2018 @05:33PM (#18742866)
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...

Re:C++20 Ranges by shakna on Saturday December 22, 2018 @06:06PM (#18743004)
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.

Re:C++20 Ranges by pjmlp on Saturday December 22, 2018 @06:47PM (#18743229)
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.

Re:C++20 Ranges by alacombe on Saturday December 22, 2018 @09:41PM (#18744071)
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.

Re:C++20 Ranges by jcelerier on Sunday December 23, 2018 @08:02AM (#18745839)
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.