Skip to content
This repository has been archived by the owner on Mar 25, 2018. It is now read-only.

first attempt at topics/async #24

Closed
wants to merge 1 commit into from
Closed

first attempt at topics/async #24

wants to merge 1 commit into from

Conversation

drewfish
Copy link
Contributor

This is a first attempt at describing asynchronous programming in node.js. It
attempts to at least mention all considerations. It also attempts to present
experience and best-practices when such are clear.

This fixes issue #20.

synchronous versions to help with this approach.

An example where synchronous programming might be OK is when writing a
commandline script. Often these scripts run a series of steps one-by-one and
Copy link
Member

Choose a reason for hiding this comment

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

"commandline" probably isn't a word on its own. Maybe "command line" or "command-line"?

@drewfish
Copy link
Contributor Author

drewfish commented Aug 5, 2015

Thanks @bengl for the feedback. I tried to address both your points.

@bengl
Copy link
Member

bengl commented Aug 5, 2015

Alright this gets a 👍 from me. Can we get another another reviewer from @nodejs/documentation on this?

-------------------------
Asynchronous programming is any technique in which the result of an operation
is available outside of the normal synchronous (statement by statement) flow
of code in a program.
Copy link
Contributor

Choose a reason for hiding this comment

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

As a document for beginners, it might be best to lead with a more concrete example of the problem we're trying to solve before introducing the solution.

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 good. Would you say the problem we're trying to solve is "synchronous programming" or "misunderstanding about asynchronous programming"? (The later is much easier to demonstrate/explain I think 😄 )

This is a first attempt at describing asynchronous programming in node.js. It
attempts to at least mention all considerations. It also attempts to present
experience and best-practices when such are clear.

This fixes issue #20.
@drewfish
Copy link
Contributor Author

OK, I think/hope I've addressed all feedback, and this is ready for another round of review.

@bengl
Copy link
Member

bengl commented Dec 9, 2015

Hey @drewfish can you resubmit this against https://github.com/nodejs/nodejs.org ?

@drewfish
Copy link
Contributor Author

@bengl submitted as nodejs/nodejs.org#422


// Another approach is to bind the function to the specific desired
// context.
setTimeout(this.increment.bind(this), 300);
Copy link
Member

Choose a reason for hiding this comment

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

doesn't setTimeout just take a this parameter?

@bengl
Copy link
Member

bengl commented Jan 14, 2016

Closing this since we won't be merging this into this repo, but probably nodejs/nodejs.org instead.

@bengl bengl closed this Jan 14, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants