-
Notifications
You must be signed in to change notification settings - Fork 30.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c++: Adopt the CppCoreGuidelines #22862
Comments
We still use |
This seems to be a very broad guide on writing good C++, so what exactly does “adopt” mean here? Also, some of these are incompatible with our own existing guidelines (e.g. use of non-const references). |
From a community POV, having an explicit and concise "guidebook" to C++ can be a huge benefit for newcomers (and current contributors who want to expand to C++). Especially since C++ is so expressive and flexible, even after learning the language knowing what is the right way to do something is very hard. I don't believe we need/can/should refactor the existing code. IMHO it's similar to when we discussed ES-next, i.e. when writing new code or fixing existing code, CCG guidelines should take precedence.
@richardlau, most of the clauses in the CCG are stylistic, and do not necessarily require new language features. They do at times recommend new features, but explain why, and how to handle legacy situations. We need as always to balance comfort and progress with code backportability.
@addaleax IMHO “adopt” means accepting those guidelines as the default. Reviewing PRs with the CCG in mind, and requesting explanations when authors overrules them.
A quote from the Google Style guide: The C++ version targeted by this guide will advance (aggressively) over time. We could agree that some of our current guidelines need to be updated. |
How about we start by adding this as a recommendation to read/look up from our style guide file? It’s a very comprehensive work, so while it certainly can help newcomers, we can’t expect them to be familiar with all of it. |
Now that we build with C++14 enabled:
By default, /std:c++14 is specified
node/common.gypi
Line 371 in 90c9368
node/common.gypi
Line 494 in 90c9368
I believe it's time we start adopting the CppCoreGuidelines
http://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines
The text was updated successfully, but these errors were encountered: