News for hackers. Stuff that matters.
Re:C++ 20: The Core Language by jandrewrogers on Tuesday November 05, 2019 @01:33PM (#21455218)
I don't encounter these barriers in commercial settings. The biggest barrier is compiler support if you target environments with different compiler toolchains. Each new version of C++ brings features and bug fixes that make code simpler. It actually reduces complexity from the perspective of the developer. The forcing function for upgrading C++ versions in my teams is always that it would greatly simplify some immediate problem or allow us to remove a gross (but necessary) hack due to the limitations of prior versions. At least with the LLVM toolchain, upgrades have been nearly issue-free so there is little to recommend not doing it. C++17 is a big upgrade over C++11 functionally. Developers that do not see compelling improvements probably weren't using most of the functionality of C++11 anyway.

While the number of features and quirks in standard C++ grows with each version, the subset that a developer needs to remember to write correct idiomatic code is shrinking with each new version as capabilities become more general and the expression of those capabilities simpler. There is a new, simpler, and vastly more capable language evolving out of the old one and you can increasingly live almost entirely within this new language as a developer. I hated classic C++ but I actually really like this new C++, and it allows me to write far less code for the same or better result.

There are still many things that C++ can express simply and efficiently that Rust, Julia, etc cannot. If you work on software that can take advantage of that expressiveness (e.g. databases in my case), the cost of changing languages is quite large.

Re:C++ 20: The Core Language by dgellow on Tuesday November 05, 2019 @02:01PM (#21455481)
> There is a new, simpler, and vastly more capable language evolving out of the old one and you can increasingly live almost entirely within this new language as a developer.

How is that true in practice? I would expect that once you have a codebase big enough, instead of living only with the new language you still have to deal with (or at least read) code written in previous versions of the language. And so instead of having to know only the modern subset you would have to keep in mind all the potential quirks from previous versions.

Re:C++ 20: The Core Language by jandrewrogers on Tuesday November 05, 2019 @03:03PM (#21456067)
Sure, you will have code written in an older idiomatic style but there is some continuity, most C++17 programmers used to be C++11/14 programmers. Upgrading code from e.g. C++11 to C++17 is relatively incremental, typically easily recognized, and can be done opportunistically. Obviously going from C++03 to C++17 would be much more expensive, so that is a bit of a different case. Rapid improvements in code analysis often breaks previously clean builds in newer compilers, so you often find yourself doing hygienic work on old C++ code anyway.

This does imply some ongoing maintenance work related solely to keeping the code base consistently "modern". This almost always makes the C++ simpler and more maintainable and often reduces the line count, so it is worth the nominal investment. The massive improvement in template code readability is worth the price of admission all by itself.

Re:C++ 20: The Core Language by cpeterso on Tuesday November 05, 2019 @03:29PM (#21456328)
Here is a proposal (from CppCon 2019) to create C++ epochs to drop support for old misfeatures in new code (inspired by Rust's epochs). Code written in the new epoch would still be fully backwards-compatible with older C++ versions and compilers.

https://www.youtube.com/watch?v=PFdKFoQxRqM

Re:C++ 20: The Core Language by steveklabnik on Tuesday November 05, 2019 @05:20PM (#21457399)
Re:C++ 20: The Core Language by Crinus on Wednesday November 06, 2019 @08:19AM (#21462186)
So you'll not only need to know all these sublanguages (epochs) but also how they interact with each other, especially when you need to refactor code that needs to cross these "epoch boundaries" (refactor the functionality not just to "upgrade" to a different epoch). Who comes up with that stuff? :-/
Re:C++ 20: The Core Language by brylie on Tuesday November 05, 2019 @04:02PM (#21456646)
How does a developer who is new to C++ learn just the modern idiomatic style? Is there a "C++, the good parts"?
Re:C++ 20: The Core Language by lenkite on Wednesday November 06, 2019 @02:00AM (#21460337)
Re:C++ 20: The Core Language by ddaa10 on Tuesday November 05, 2019 @05:03PM (#21457234)
Re:C++ 20: The Core Language by tcbawo on Wednesday November 06, 2019 @12:16AM (#21459916)
This has been my experience also. Of course you can't forget the old stuff if you're maintaining an old codebase. But, I'm grateful to use lambdas, std algorithm, if constexpr, and fold expressions instead of boilerplate classes, bespoke loops, SFINAE hackery, and recursive variadic functions. There is less wizardry necessary than in the past.