-
-
Notifications
You must be signed in to change notification settings - Fork 33.5k
doc: cleanup and add references to CPP_STYLE_GUIDE.md #23650
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
Conversation
CPP_STYLE_GUIDE.md
Outdated
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.
thorw
->throw
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.
ack
CPP_STYLE_GUIDE.md
Outdated
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.
trasfers
->transfers
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.
ack
CPP_STYLE_GUIDE.md
Outdated
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.
This referred specifically to throwing exceptions, though.
(s/error/exception/ would be a good change here, that’s on me.)
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.
ack
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.
Can you clear this up for me? we can't c++ throw
, we need to isolate()->ThrowException()
right?
CPP_STYLE_GUIDE.md
Outdated
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.
typo: it is (twice)
(and maybe s/essential/necessary/)
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.
ack x 3
CPP_STYLE_GUIDE.md
Outdated
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.
This seemed sensible in previous form? There’s no reason to use it in our code, and that it’s deprecated/removed is not really of concern if you already know not to use it
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 didn't like the phrasing "Never use", also I do believe an explanation why is nice, since it's very short.
Maybe:
Don't use `std::auto_ptr`.<br/>
It was deprecated in C++11 if favor of `std::unique_ptr`, and later removed from
C++17. `std::unique_ptr` has move semantics instead the of unusual copy
semantics of `std::auto_ptr`.
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.
Actually we should be able to lint for that. I'll see if I can figure out how to.
CPP_STYLE_GUIDE.md
Outdated
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.
nit: blank lines around code block
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.
ack
CPP_STYLE_GUIDE.md
Outdated
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’d really like it if we could make these links more expressive instead of just having the item numbers in the text, e.g. Further reading in the [C++ Core Guidelines][ES.47]
?
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.
ack
CPP_STYLE_GUIDE.md
Outdated
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.
Currently, this and next lines are rendered as one line.
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.
ack
CPP_STYLE_GUIDE.md
Outdated
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.
If you want a list of things, you can juse start lines with *
instead of manually inserting line breaks
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.
ack x 3
CPP_STYLE_GUIDE.md
Outdated
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.
No need for a line break, this makes sense as one paragraph.
CPP_STYLE_GUIDE.md
Outdated
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.
ditto here
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.
Thanks!
CPP_STYLE_GUIDE.md
Outdated
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.
This somehow reads a bit ambiguous to me now that it's exception
, can you change it to JavaScript exception
?
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.
Ack
CPP_STYLE_GUIDE.md
Outdated
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.
Do we need to explain this here? Can we link to some docs somewhere?
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.
Ack (ish). PTAL
CPP_STYLE_GUIDE.md
Outdated
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.
@joyeecheung, @addaleax PTAL
I'm trying to grok this, so I wrote it down.
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.
s/isolate/Isolate/, and the comma should be removed
I don’t think it matters that it’s an Isolate
thing, though. That’s implementation details, and you can just say “JS execution state” or something like that.
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.
Ack
CPP_STYLE_GUIDE.md
Outdated
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.
s/exception semantics/exceptions/?
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 went with exception handling
and added a reference (GCC state 7% runtime cost which I think is interesting).
CPP_STYLE_GUIDE.md
Outdated
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.
s/isolate/Isolate/, and the comma should be removed
I don’t think it matters that it’s an Isolate
thing, though. That’s implementation details, and you can just say “JS execution state” or something like that.
41872c5
to
5764fdb
Compare
PR-URL: nodejs#23650 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
5764fdb
to
cf3f8dd
Compare
PR-URL: #23650 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #23650 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #23650 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #23650 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
PR-URL: #23650 Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Joyee Cheung <[email protected]>
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes