| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
This documents existing practices.
|
@addaleax build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/1326/pipeline |
Sorry, something went wrong.
|
I thought we agreed to adopt the C++ Core Guidelines exactly to close the omissions in the style guide, and have explicit and well reasoned guidelines. Could you provide reasons for this change? |
Sorry, something went wrong.
What is says in the PR description. It documents what we currently have. Preferring to document existing style before working on changes was also what was echoed as a sentiment in the last TSC meeting.
We agreed to link these documents since they provide meaningful guidelines. They do not match our current style in all cases; for those cases, we have this very document. |
Sorry, something went wrong.
|
|
||
| Use explicit comparisons to `nullptr` when testing pointers, i.e. | ||
| `if (foo == nullptr)` instead of `if (foo)` and | ||
| `foo != nullptr` instead of `!foo`. |
There was a problem hiding this comment.
For consistency, maybe make this if (foo != nullptr) and if (!foo).
Sorry, something went wrong.
There was a problem hiding this comment.
@cjihrig yup, done!
Sorry, something went wrong.
There was a problem hiding this comment.
I would like to ask for a reference for where this guideline came from, and what is it's reasoning.
Sorry, something went wrong.
|
@refack This is, as the PR says, an existing practice that we follow. I can only speculate about the reasons why it was introduced, but it does follow the general “explicit is better than implicit” rule, and makes clear whether a check tests a pointer or a boolean. The origins of the rule definitely predate my time around here (and I’m not so sure about their relevance). @bnoordhuis might know. |
Sorry, something went wrong.
This documents existing practices. PR-URL: #23805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This documents existing practices. PR-URL: #23805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This documents existing practices. PR-URL: #23805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This documents existing practices. PR-URL: #23805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This documents existing practices. PR-URL: #23805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
This documents existing practices. PR-URL: #23805 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
| Back | FazBrowse Home | New Git URL |
This documents existing practices.
Checklist