5 ms·
I think the HN title is incorrect, the title in the linked post just says C++17, not C17. Likewise, the JEP doesn't really mention C other than in passing, and
by eklitzke 3y ago
I think the HN title is incorrect, the title in the linked post just says C++17, not C17. Likewise, the JEP doesn't really mention C other than in passing, and the OpenJDK code I've looked at myself is all written in C++, so AFAIK this is really just a change from C++14 to C++17.
As for the differences between C++14 and C++17, the things I use most often are consexpr if, variable declaration in if statements, std library features like std::optional and std::string_view, lambdas got more powerful, and probably a bunch of other things I'm forgetting. There are a ton of "What's new in C++17" articles you can find online if you want more information.
- mfiguiere 3y agoThe title of the draft JEP was "Move the JDK to C17 and C++17" at the time of posting but has been changed later to "Compile the JDK as C++17". Not able to edit the HN post anymore.
- tjalfi 3y agoYou can email hn@ycombinator.com and they'll fix it.
- marginalia_nu 3y agoThere's a weird tendency to lump together C and C++ into "C/C++", as though it was the same language. Makes about as much sense as Java/Javascript at this point.
- SubjectToChange 3y agoThere's a weird tendency to lump together C and C++ into "C/C++", as though it was the same language. It’s about as weird as writing “HTML/CSS/JS”, or “Java/Kotlin”. Like it or not people write related languages and technologies that way. Makes about as much sense as Java/Javascript at this point. Do you know what “ISO/IEC JTC1/SC22/WG21/SG22” is? It’s the C and C++ Compatibility Study Group for ISO C++. For instance the only reason C++20 added designated initializers was for improving C compatibility. Stop pretending C and C++ have nothing to do with each other. Using “C/C++” is fine.
- rewmie 3y ago> For instance the only reason C++20 added designated initializers was for improving C compatibility. That would be true if you ignore the fact that designated initializers are superb syntactic sugar that greatly contributes to fewer bugs and better readability.
- SubjectToChange 3y agoC++ has constructors, designated initializers are redundant.
- Night_Thastus 3y agostd::optional is so great. No more magic return values! Forces people to consider whether something will exist than just writing for the best case.