-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
doc: change Node.js style to error-first style #17638
Conversation
I think these were the only two files ( |
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.
Looks good to me! Would like it even more if we go further and remove style
so it's just error-first callback
and not error-first style callback
.
doc/api/errors.md
Outdated
|
||
<!--type=misc--> | ||
|
||
Most asynchronous methods exposed by the Node.js core API follow an idiomatic | ||
pattern referred to as a "Node.js style callback". With this pattern, a | ||
pattern referred to as an "error-first style callback". With this pattern, a |
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.
Super-tiny nit here, and I know this was in the original text and not something you introduced, so feel free to ignore this, but it would be good to replace the quotation marks in this line with italics because that's the standard typography for words-as-words. (See https://en.wikipedia.org/wiki/Wikipedia:Manual_of_Style/Text_formatting#Words_as_words for more information if curious.)
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 problem
FYI -- triggered CI but Jenkins is being a little weird right now. Don't have a link to paste yet. |
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.
LGTM even though I would like my comment to be incorporated.
doc/api/errors.md
Outdated
|
||
<!--type=misc--> | ||
|
||
Most asynchronous methods exposed by the Node.js core API follow an idiomatic | ||
pattern referred to as a "Node.js style callback". With this pattern, a | ||
pattern referred to as an _error-first callback_. With this pattern, a |
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.
For historical reasons it would be good to keep a reference to the Node.js style callback as in:
... error-first callback, historically called `Node.js style callback`.
The reason is that e.g. blog posts and other documentations might still call them like this and it would be good to find a explanation even with the new name.
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.
Rather than historically
I'd prefer the simpler and arguably-more-accurate sometimes
...
... an _error-first callback_ (sometimes referred to as a _Node.js style callback_) ...
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.
sounds correct to me as well. Done 👍
We change the awkward "Node.js style callback" phrasing to the more informative "error-first style callback," which is more in line with its usage Refs: nodejs#17593 (comment)
5db6ae5
to
9f13040
Compare
Change the awkward "Node.js style callback" phrasing to the more informative "error-first callback." PR-URL: #17638 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Change the awkward "Node.js style callback" phrasing to the more informative "error-first callback." PR-URL: #17638 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Change the awkward "Node.js style callback" phrasing to the more informative "error-first callback." PR-URL: #17638 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Change the awkward "Node.js style callback" phrasing to the more informative "error-first callback." PR-URL: nodejs/node#17638 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Change the awkward "Node.js style callback" phrasing to the more informative "error-first callback." PR-URL: #17638 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
Change the awkward "Node.js style callback" phrasing to the more informative "error-first callback." PR-URL: #17638 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Jon Moss <[email protected]> Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Jeremiah Senkpiel <[email protected]>
We change the awkward "Node.js style callback" phrasing to the
more informative "error-first style callback," which is more
in line with its usage
Refs: #17593 (comment)
Checklist
Affected core subsystem(s)
doc