News for hackers. Stuff that matters.
Re:All C++20 core language features with examples by throwaway894345 on Wednesday April 07, 2021 @10:43AM (#26725644)
C++ used to be the industry leading language in many more fields, but it lost ground to other languages. Not a bad thing--"know thyself" and all that. But Rust seems like a credible threat to C++'s remaining niches (bury your head in the sand if you want), and C++ will need to evolve if it is to not lose further market-/mindshare. And it is evolving, as this article points out, but a huge glaring pain point in C++ development remains the build and package management tooling. The aforementioned build systems that large organizations operate aren't nearly as nice as, say, Cargo and I think a lot of greenfield projects who have to choose between cobbling together their own build tool to work with C++ and using Rust + Cargo off the shelf will choose the latter (other factors notwithstanding).
Re:All C++20 core language features with examples by pjmlp on Wednesday April 07, 2021 @10:50AM (#26725757)
I will get worried when NVidia releases CUDA-Rust, and changes their GPGPUs from C++ memory model to Rust, Microsoft decides to rewrite WinUI in Rust, Apple moves Metal from C++ into Rust, or Unreal/Unity get rewritten in Rust.
Re:All C++20 core language features with examples by throwaway894345 on Wednesday April 07, 2021 @10:56AM (#26725839)
Like I said:

> bury your head in the sand if you want

Great chat, as always. :)

Re:All C++20 core language features with examples by adamdusty on Wednesday April 07, 2021 @05:00PM (#26731193)
Rust is so far from taking over c++, you could bury your head, my head, and everyone else's head in the sand and we'd still be waiting.
Re:All C++20 core language features with examples by fsloth on Wednesday April 07, 2021 @11:40AM (#26726497)
You write as if Rust vs. C++ was some sort of competition.

I don't understand this - they are not competing brands or sports teams but tools.

Why would it matter and to whom if C++ use would decline?

If use of C++ declines then I don't understand how that would make the language a lesser tool.

Choose the best tool for the job and all that.

Re:All C++20 core language features with examples by ansible on Wednesday April 07, 2021 @12:20PM (#26727095)
> You write as if Rust vs. C++ was some sort of competition.

Competition exists all around us, all the time, whether we like it or not.

And the competition between C++ and Rust is very clear. I, for example, would likely be spending more time / effort on learning the latest C++ standards if Rust didn't exist. And likely hate my life a little bit, unless I could exclusively stick to C++ "the good parts" if such a subset exists and I didn't need to interface as much with existing C++ code.

Re:All C++20 core language features with examples by criddell on Wednesday April 07, 2021 @12:23PM (#26727137)
My job is writing C++ and I love it. I've been working with C++ since the mid 90's and have grown very fond of the language and I'm pretty productive in it.

If C++ use declines, then there are fewer opportunities for me. So you can count me as a member of team C++.

Re:All C++20 core language features with examples by fsloth on Wednesday April 07, 2021 @12:32PM (#26727254)
I also write C++ for a living but feel no threat if I had to suddenly start writing C, C#, Java, Python, Rust, F#, Scala, or what have you. Sure, it would need learning a thing or two but basically they all are driving the same ARM or x86 based compute stack with exactly the same constraints due to computer architecture .

My focus has been to brand myself as "domain expert" in few algorithmic domains rather than "C++" expert so this may affect my point of view, though.

Re:All C++20 core language features with examples by criddell on Wednesday April 07, 2021 @01:47PM (#26728285)
> feel no threat if I had to suddenly start writing C, C#, Java, Python, Rust, F#, Scala

It isn't necessarily a threat. I'm pretty comfortable in a bunch of different languages but just enjoy C++ more than the others. To use a car analogy, I have no problem driving automatic but I really like driving stick.

Re:All C++20 core language features with examples by kazinator on Wednesday April 07, 2021 @12:29PM (#26727215)
If you don't keep up with all this C++20 material, there will likewise be fewer opportunities for you. They will throw it at you in an interview, to check that you aren't some stubborn C++98 gunslinger.
Re:All C++20 core language features with examples by criddell on Wednesday April 07, 2021 @01:45PM (#26728249)
I do my best! I really enjoy working in C++ and it's a pretty exciting time for me when a new standard rolls around and my compiler gets updated to support it.
Re:All C++20 core language features with examples by p0nce on Wednesday April 07, 2021 @01:56PM (#26728421)
How long will that take you to assimilate those C++20 features?
Re:All C++20 core language features with examples by criddell on Wednesday April 07, 2021 @02:13PM (#26728692)
Years. Some things are obviously useful right away and other things take me a lot longer to grok. For example, rvalue references have been around for a long time now and I still have to slow down when I see && in code.
Re:All C++20 core language features with examples by Koshkin on Wednesday April 07, 2021 @02:19PM (#26728786)
Learning new features is not hard; putting these in practice usually depends solely on their support by the compiler.
Re:All C++20 core language features with examples by throwaway894345 on Wednesday April 07, 2021 @12:12PM (#26726990)
> If use of C++ declines then I don't understand how that would make the language a lesser tool.

The hypothesis is that C++ will decline because it becomes the lesser tool (where "lesser tool" means it excels only in increasingly small niches) if it doesn't adapt. That said, the C++ community seems to want to adapt and remain relevant, as indicated by its significant progress over the last decade.

As for why someone might care about the usage of a programming language: because "ease of finding developers" and "quality and breadth of ecosystem" are major factors in deciding on new projects. I.e., "the best tool for the job" is often the one with the broader ecosystem and more developers, all else equal. So these factors feed back on each other.

Re:All C++20 core language features with examples by kazinator on Wednesday April 07, 2021 @12:26PM (#26727178)
> Why would it matter and to whom if C++ use would decline?

If the use declines to zero, then all the effort someone put into developing C++ compilers and related tooling had been for naught, as are C++ development skills.

Re:All C++20 core language features with examples by fsloth on Wednesday April 07, 2021 @02:28PM (#26728915)
Given the prevalence of C++ it is very hard for me to imagine a situation where the use would decline to zero.

The notion of how to write a specific language such as C++ is immaterial compared to the capability to design and implement complex software systems and those skills are quite portable between languages. The best employers tend to recognize this.