Skip to content
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

Closed
wants to merge 4 commits into from

Conversation

ramsgoli
Copy link
Contributor

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

@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Dec 12, 2017
@ramsgoli
Copy link
Contributor Author

I think these were the only two files (errors.md and util.md) where Node.js style callback was used, please comment if there are any other places where this change can be made 😄

@vsemozhetbyt vsemozhetbyt added the fast-track PRs that do not need to wait for 48 hours to land. label Dec 13, 2017
Copy link
Member

@Trott Trott left a 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.


<!--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
Copy link
Member

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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

👍 no problem

@maclover7
Copy link
Contributor

FYI -- triggered CI but Jenkins is being a little weird right now. Don't have a link to paste yet.

@vsemozhetbyt
Copy link
Contributor

vsemozhetbyt commented Dec 13, 2017

Copy link
Member

@BridgeAR BridgeAR left a 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.


<!--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
Copy link
Member

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.

Copy link
Member

@Trott Trott Dec 13, 2017

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_) ...

Copy link
Contributor Author

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)
@apapirovski
Copy link
Member

apapirovski pushed a commit that referenced this pull request Dec 17, 2017
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]>
@apapirovski
Copy link
Member

Landed in 3db136a. Thanks @ramsgoli!

MylesBorins pushed a commit that referenced this pull request Jan 8, 2018
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]>
MylesBorins pushed a commit that referenced this pull request Jan 9, 2018
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]>
@MylesBorins MylesBorins mentioned this pull request Jan 10, 2018
boingoing pushed a commit to nodejs/node-chakracore that referenced this pull request Jan 18, 2018
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]>
MylesBorins pushed a commit that referenced this pull request Jan 23, 2018
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]>
gibfahn pushed a commit that referenced this pull request Jan 24, 2018
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations. fast-track PRs that do not need to wait for 48 hours to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.