GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: formalize `auto` usage in C++ style guide by addaleax · Pull Request #23028 · nodejs/node

Conversation

@addaleax

@addaleax addaleax commented Sep 22, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Adjust heading levels to align with the table of contents, and write down 2 more existing rules (avoiding non-const references and auto under most circumstances).

We generally avoid using auto if not necessary. This formalizes this rules by writing them down in the C++ style guide.

The other part of the PR has been split out into #23155.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • documentation is changed or added
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

bricss reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@nodejs-github-bot

nodejs-github-bot commented Sep 22, 2018

Copy link
Copy Markdown
Collaborator

@addaleax build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/979/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to Node.js documentation. label Sep 22, 2018
@addaleax addaleax mentioned this pull request Sep 22, 2018
cli: normalize _ → - when parsing options #23020
Closed
4 tasks done
tniessen
tniessen approved these changes Sep 22, 2018
View reviewed changes
lpinca
lpinca approved these changes Sep 22, 2018
View reviewed changes
@addaleax
addaleax force-pushed the cpp-style-update branch from 4395d62 to 650305a Compare September 22, 2018 20:08
refack
refack approved these changes Sep 22, 2018
View reviewed changes

@refack refack left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with google style guide & C++ Core Guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
refack
refack suggested changes Sep 22, 2018
View reviewed changes

@refack refack left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conflicts with google style guide & C++ Core Guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
joyeecheung
joyeecheung approved these changes Sep 22, 2018
View reviewed changes
Comment thread CPP_STYLE_GUIDE.md Outdated

@joyeecheung joyeecheung Sep 22, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@refack refack Sep 22, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the main benefits of adopting an established style guide is to reduce bikeshedding. I recommend the following talk by Herb Sutter (head of the c++ ISO group) https://www.youtube.com/watch?v=hEx5DNLWGgA

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@jasnell jasnell Sep 23, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also found auto convenient and helpful when the type is obvious from context... e.g.

auto traced_value = tracing::TracedValue::Create();

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@joyeecheung joyeecheung Sep 23, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@refack Just realized I watched the same argument made by Herb Sutter in 2014 back in 2015 but still my experience in real-world code bases taught me otherwise...not that I am completely against auto, though, but I still prefer explicit types when it helps with readability, especially in code reviews where the diff may be out of context and there is no IDE to help analyzing the types.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

refack reacted with heart emoji
All reactions
  • ❤️ 1 reaction

@addaleax addaleax Sep 23, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jasnell Even in that example one would have to look up what Create() actually returns… for example, it could definitely be either a smart pointer or a regular pointer.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@refack refack Sep 24, 2018

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the point is to reduce "clutter" and allow the reader to focus on the intent of the code.
In most cases the exact type of (for example) traced_value is probably not relevant for review purposes, it might even be a distraction from what the code actually does. From the idea that the more we have to read, we have less focus on the actual point of the change.

After all that is what 100% of code in JS looks like and we manage excellently.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@addaleax addaleax Sep 24, 2018

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the point is to reduce "clutter" and allow the reader to focus on the intent of the code.

There are other measures, though – in particular, correctness is an important one. By requesting more explicit types, we put that before focusing on intent (as in this example).

After all that is what 100% of code in JS looks like and we manage excellently.

If that were completely true, things like TypeScript wouldn’t exist – which is something that’s used by 46 % of npm users, after all, and the added correctness guarantees are definitely a major reason for that.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@joyeecheung joyeecheung Sep 24, 2018

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@refack

After all that is what 100% of code in JS looks like and we manage excellently.

Not necessarily, for properties and a lot of local variables we initialize them upfront so in the declaration it's already very clear what their types are supposed to be. Personally I would want to see more JSDoc-like annotations in lib (not necessary for simple helpers, but would be very helpful for functions with a lot of arguments named with something like obj, value, handle, .etc).

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@refack

refack commented Sep 22, 2018

Copy link
Copy Markdown
Contributor

I was just about to suggest the opposite, on both clauses. They are both counter-idiomatic with "modern" C++ (c++11 and higher).
From the C++CG:

  • ES.11: Use auto to avoid redundant repetition of type names
  • P.3: Express intent
    With the two first examples:
    for (const auto& x : v) { /* do something with the value of x */ }
    for (auto& x : v) { /* modify x */ }

From the Google style guide:

  • auto - Use auto to avoid type names that are noisy, obvious, or unimportant - cases where the type doesn't aid in clarity for the reader. Continue to use manifest type declarations when it helps readability.
    for (const auto& item : some_map) {
      const KeyType& key = item.first;
      const ValType& value = item.second;
      // The rest of the loop can now just refer to key and value,
      // a reader can see the types in question, and we've avoided
      // the too-common case of extra copies in this iteration.
    }

Both guides have specific rules for function arguments:

  • Google Reference Arguments - All parameters passed by lvalue reference must be labeled const.
  • F.16: For “in” parameters, pass cheaply-copied types by value and others by reference to const
  • F.17: For “in-out” parameters, pass by reference to non-const
All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack

refack commented Sep 22, 2018

Copy link
Copy Markdown
Contributor

tl;dr IMHO we should improve our style and guidelines by learning from experienced source in order to improve our code correctness, readability, maintainability, and reduce the entry barrier.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@joyeecheung

joyeecheung commented Sep 22, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

@refack The sections about auto in C++ Core Guidelines and the Google style are not in direct conflict with this patch. In the Google style guide, it does suggest that:

Continue to use manifest type declarations when it helps readability.

And the decision is in favor of explicit types:

auto is permitted when it increases readability, particularly as described below. Never initialize an auto-typed variable with a braced initializer list.

In the C++ Core Guidelines

Exception: Avoid auto for initializer lists and in cases where you know exactly which type you want and where an initializer might require conversion.

They both bring up templates as examples where using auto helps with readability and that's also what this patch suggests.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Sep 22, 2018

Copy link
Copy Markdown
Member Author

I can’t find anything on local (non-parameter) references in the Google style guide, but the policy you linked to is in agreement with this PR for function parameters. I’ve also only very rarely at best seen non-const references in the V8 or Chromium sources.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack

refack commented Sep 22, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

They both bring up templates as examples where using auto helps with readability and that's also what this patch suggests.

But the current suggestion is Being explicit about types is preferred over using `auto`.
I suggest a line with an opposite motive (Well I suggest adopting the established guides but) where the gist is: Using `auto` is preferred to being unnecessarily explicit with the exceptions given in both places.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack

refack commented Sep 22, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

I'll give an example that came up during review:

for (std::string::size_type i = 0; i < name.size(); ++i) {
  if (name[i] == '_') 
    name[i] = '-';
}

or

for (auto& i : name) {
  if (i == '_') 
    i = '-';
}

Which would be easier for a newcomer to understand? Which one give the compiler more chances to validate the code, and optimize the binary?
I guess this is such a common pattern that it has a corresponding guideline - ES.55: Avoid the need for range checking

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack

refack commented Sep 23, 2018

Copy link
Copy Markdown
Contributor

Total serendipity, I stumbled upon this talk about what compilers actually do for these loops, and what they are optimizing
https://www.youtube.com/watch?v=bSkpMdDe4g4

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Sep 23, 2018

Copy link
Copy Markdown
Member Author

I suggest a line with an opposite motive (Well I suggest adopting the established guides but) where the gist is: Using `auto` is preferred to being unnecessarily explicit with the exceptions given in both places.

I’m not sure about the others around here, but from the people who review a lot of C++ code on a regular basis, both @joyeecheung and me seem to think that this would impact reviewability and readability negatively.

Which would be easier for a newcomer to understand?

Honestly, I think it depends, both on how “new” the newcomer is and what exactly “understand” means here. The for-range + auto version has the advantage of being easy to write, but it does come with a bit less clarity on what i actually is and that name is the variable that is ultimately being modified here.

Which one give the compiler more chances to validate the code, and optimize the binary?

Both should result in similar code – but we shouldn’t even bother worrying about this question in code that is not performance-critical.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@refack

refack commented Sep 24, 2018

Copy link
Copy Markdown
Contributor

I’m not sure about the others around here, but from the people who review a lot of C++ code on a regular basis, both @joyeecheung and me seem to think that this would impact reviewability and readability negatively.

I'm not sure what you meant by that, it reads to me like you want that group to stay small and exclusive?

BTW my formal education and experience is in "classic" C++, and all this "modern" stuff is completely new, and still groking our current C++ code IMHO is too hard.

IMHO if our coding guidelines were more in line with established guides (i.e. what you can learn in books and courses, as opposed to word of mouth kept by a small group), the group of C++ writers and reviewers could more more inclusive.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gireeshpunathil
gireeshpunathil approved these changes Sep 24, 2018
View reviewed changes
@gireeshpunathil

gireeshpunathil commented Sep 24, 2018

Copy link
Copy Markdown
Member

Is this (C++ style guide document) the exact set or subset or a superset of what compiler / make format-cpp already captures? I believe it is none?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Sep 24, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

I’m not sure about the others around here, but from the people who review a lot of C++ code on a regular basis, both @joyeecheung and me seem to think that this would impact reviewability and readability negatively.

I'm not sure what you meant by that, it reads to me like you want that group to stay small and exclusive?

I don’t know how you came to that conclusion based on what I said.

If anything, it’s the opposite – I’d love for the number of people who work on and with our C++ code base to increase. That would make both my life easier and improve Node’s quality on its own.

I’m not sure how to rephrase the above sentence, though. What I meant is that from the existing frequent reviewers, two of us have, based on our experience, come to the conclusion that your suggestion would likely not be an improvement if readability and reviewability are the values by which we judge it. I’d be happy for other people to share their experience as well.

BTW my formal education and experience is in "classic" C++, and all this "modern" stuff is completely new, and still groking our current C++ code IMHO is too hard.

Just to clarify how this relates to the current argument – are you saying these rules would make understanding existing code easier for you?

I understand that our code base is not the most easily accessible one, but as far as I can tell, the main issues that people have are around concepts that are specific to V8 or libuv.

IMHO if our coding guidelines were more in line with established guides (i.e. what you can learn in books and courses, as opposed to word of mouth kept by a small group), the group of C++ writers and reviewers could more more inclusive.

Our guidelines are quite close to the Google ones that you also refer to, especially with regards to the particular items that we’re discussing here.

Is this (C++ style guide document) the exact set or subset or a superset of what compiler / make format-cpp already captures? I believe it is none?

Yeah, it is neither – for example, the rules here can’t be enforced through formatting alone.

gireeshpunathil reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

danbev
danbev approved these changes Sep 24, 2018
View reviewed changes
@jasnell

jasnell commented Sep 24, 2018

Copy link
Copy Markdown
Member

@addaleax ... I'm happy with everything in this except the bits about auto. Do you think it would be possible to separate that one bit out to a separate PR that we can discuss separately without blocking the rest of this?

On the auto part, I think we should likely be more explicit about the cases where it's ok. With some examples included.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax

addaleax commented Sep 24, 2018

Copy link
Copy Markdown
Member Author

@jasnell It looks like this PR is going to be blocked as a whole anyway… I’ll split out the first commit, though, so that we can split the auto section more easily later if it’s necessary.

I’ve also updated the text on auto to be closer to Google’s guidelines + added their example, and I’ll think about more examples that would be good to include here.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

addaleax added a commit to addaleax/node that referenced this pull request Sep 24, 2018
@addaleax
doc: fix heading levels in C++ style guide
084a043
Adjust heading levels to align with the table of contents.

Refs: nodejs#23028
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
@addaleax addaleax mentioned this pull request Sep 24, 2018
doc: fix heading levels in C++ style guide #23061
Closed
3 tasks done
@addaleax
addaleax force-pushed the cpp-style-update branch from 0fc3c63 to 1a97e31 Compare September 24, 2018 18:15
addaleax added a commit to addaleax/node that referenced this pull request Sep 24, 2018
@addaleax
doc: fix heading levels in C++ style guide
50944f3
Adjust heading levels to align with the table of contents.

Refs: nodejs#23028
PR-URL: nodejs#23061
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
targos pushed a commit that referenced this pull request Sep 24, 2018
@addaleax @targos
doc: fix heading levels in C++ style guide
0519689
Adjust heading levels to align with the table of contents.

Refs: #23028
PR-URL: #23061
Reviewed-By: Vse Mozhet Byt <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
@joyeecheung

joyeecheung commented Sep 25, 2018

Copy link
Copy Markdown
Member

Is this (C++ style guide document) the exact set or subset or a superset of what compiler / make format-cpp already captures? I believe it is none?

I believe you are correct, make format-cpp only handles style nits, but it knows nothing about types - it's clang-format underneath, to do proper linting clang-tidy is a better tool although it may be way too slow for our codebase.

addaleax reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax mentioned this pull request Sep 29, 2018
doc: formalize non-const reference usage in C++ style guide #23155
Closed
3 tasks done
@addaleax addaleax added the c++ Issues and PRs that require attention from people who are familiar with C++. label Sep 29, 2018
@addaleax

addaleax commented Sep 29, 2018

Copy link
Copy Markdown
Member Author

@refack Split out into #23155.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

refack
refack approved these changes Sep 29, 2018
View reviewed changes
@refack

refack commented Sep 29, 2018

Copy link
Copy Markdown
Contributor

Split out into #23155.

Thank you

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax added the author ready PRs with CI started, the required approvals, and no outstanding review comments. label Sep 29, 2018
@addaleax

addaleax commented Sep 30, 2018

Copy link
Copy Markdown
Member Author

Landed in aba7677

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@addaleax addaleax closed this Sep 30, 2018
@addaleax
addaleax deleted the cpp-style-update branch September 30, 2018 15:32
addaleax added a commit that referenced this pull request Sep 30, 2018
@addaleax
doc: formalize auto usage in C++ style guide
aba7677
We generally avoid using `auto` if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

PR-URL: #23028
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
targos pushed a commit that referenced this pull request Oct 1, 2018
@addaleax @targos
doc: formalize auto usage in C++ style guide
7d34177
We generally avoid using `auto` if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

PR-URL: #23028
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
targos pushed a commit that referenced this pull request Oct 3, 2018
@addaleax @targos
doc: formalize auto usage in C++ style guide
e791abe
We generally avoid using `auto` if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

PR-URL: #23028
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
@targos targos mentioned this pull request Oct 7, 2018
Release proposal: v10.12.0 #23313
Merged
This was referenced Oct 10, 2018
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#225
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#239
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#226
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#240
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#227
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#241
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#242
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#228
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-android-nodejs#243
Closed
2018-10-10 Version 10.12.0 (Current) @targos beevelop/docker-nodejs#229
Closed
addaleax added a commit that referenced this pull request Oct 21, 2018
@addaleax
doc: formalize non-const reference usage in C++ style guide
5550510
We generally avoid using non-const references if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

(Note: Some reviews are from the original PR.)

Refs: #23028
PR-URL: #23155
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
jasnell pushed a commit that referenced this pull request Oct 21, 2018
@addaleax @jasnell
doc: formalize non-const reference usage in C++ style guide
eaff120
We generally avoid using non-const references if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

(Note: Some reviews are from the original PR.)

Refs: #23028
PR-URL: #23155
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@refack refack mentioned this pull request Nov 15, 2018
doc: make C++ core guidelines a reference #24315
Closed
MylesBorins pushed a commit that referenced this pull request Nov 26, 2018
@addaleax @MylesBorins
doc: formalize non-const reference usage in C++ style guide
30b1a4a
We generally avoid using non-const references if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

(Note: Some reviews are from the original PR.)

Refs: #23028
PR-URL: #23155
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
rvagg pushed a commit that referenced this pull request Nov 28, 2018
@addaleax @rvagg
doc: formalize non-const reference usage in C++ style guide
8e54ee1
We generally avoid using non-const references if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

(Note: Some reviews are from the original PR.)

Refs: #23028
PR-URL: #23155
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
MylesBorins pushed a commit that referenced this pull request Nov 29, 2018
@addaleax @MylesBorins
doc: formalize non-const reference usage in C++ style guide
75082ee
We generally avoid using non-const references if not necessary. This
formalizes this rules by writing them down in the C++ style guide.

(Note: Some reviews are from the original PR.)

Refs: #23028
PR-URL: #23155
Reviewed-By: Tobias Nießen <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Gireesh Punathil <[email protected]>
Reviewed-By: Daniel Bevenius <[email protected]>
Reviewed-By: Sakthipriyan Vairamani <[email protected]>
Reviewed-By: Michael Dawson <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Ali Ijaz Sheikh <[email protected]>
Reviewed-By: Anatoli Papirovski <[email protected]>
@refack refack mentioned this pull request Feb 14, 2019
src: fix modernize-return-braced-init-list #26023
Closed
2 tasks done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jasnell jasnell jasnell left review comments
@tniessen tniessen tniessen approved these changes
@joyeecheung joyeecheung joyeecheung approved these changes
@lpinca lpinca lpinca approved these changes
@gireeshpunathil gireeshpunathil gireeshpunathil approved these changes
+4 more reviewers
@refack refack refack approved these changes
@danbev danbev danbev approved these changes
@thefourtheye thefourtheye thefourtheye approved these changes
@mhdawson mhdawson mhdawson approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

author ready PRs with CI started, the required approvals, and no outstanding review comments. c++ Issues and PRs that require attention from people who are familiar with C++. doc Issues and PRs related to Node.js documentation.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

11 participants

@addaleax @nodejs-github-bot @refack @joyeecheung @gireeshpunathil @jasnell @danbev @thefourtheye @lpinca @tniessen @mhdawson
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.