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

Adds callbacks and async readme #1

Merged
merged 10 commits into from
Apr 16, 2016
Merged

Adds callbacks and async readme #1

merged 10 commits into from
Apr 16, 2016

Conversation

ezmiller
Copy link
Contributor

@ezmiller ezmiller commented Apr 4, 2016

@pletcher opening this PR for review of the README. Let me know if this isn't the right way to indicate it's ready to be reviewed.

Some initial comments/questions:

  • The examples I've used here aren't code-able as you'll see. More simple algorithmic cases. Not sure if that fits the flatiron style...
  • The callback example I used at the end is jQuery AJAX. That's familiar as you said, but it's not exactly the kind of syntax they'll run into in Node. In the next lab, they'll encounter the other form, though. Maybe it's good to have them see the range of places that callbacks are used in the first two parts of the unit. The lab can specify: e.g. "before you saw a callback in an ajax request, here you'll see it with a different syntax, more common in Node..."

@pletcher
Copy link
Contributor

pletcher commented Apr 5, 2016

Leaving a general comment here, and then I'll comment in more detail inline.

This is excellent. I really like how carefully you walk students through the problems of asynchrony. The readme gives students just enough time to catch their breath after every major point while still challenging them to think outside of the procedural programming box that they've gotten used to.

If anything, the beginning might be a little too gentle. I think it'd be okay to throw students into the deep-end a bit: make them "feel the pain," as Flatiron likes to say, and then give them the solution. (The PB&J example makes them feel a bit of pain, but that might just be hunger.)

The examples are similarly great, but I wonder if we can introduce them to Node.js-style callbacks by way of $.get(url, function(data) { ... }). It's not quite "The Node Way"™, since it's not an error-first callback; but that also sets up a potential dialogue around why Node.js settled on error-first as a style choice (more than anything) -- but perhaps I'm getting ahead of myself. Just some thoughts.

@AnnJohn might have additional comments; I'll go through and make some notes inline.


## Overview

In this lesson we will learn how to manage a common challenge that one encounters when architecting Node applications: namely, what do you do when you need a part of your program to run *now* and then another part of it to run *later*? This situation, known as "asychronous processing" (or just "async"), is a key Node programming skill. By the end of this lesson you'll be able to:
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we tighten this up? I really like how you present the problem ("What do you do when you need a part of your program..."), and I wonder if we can really zero in to focus on that question.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup agree. I think we can just start with that line "...what do you do when you need a part..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@ezmiller
Copy link
Contributor Author

@AnnJohn and @pletcher first round of revisions are finished here. Please notice my changes at the section at the end where you both had your more substantive comments. I think it still reads alright, but your feedback would be helpful.


* Excellent longer analysis of async in JS: Kyle Simpson,*You Don't Know JS: Async & Performance*, Chs. [1](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20&%20performance/ch1.md) and [2](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20&%20performance/ch2.md)

[^1]: Kyle Simpson, Kyle Simpson, ["Chapter 2: Callbacks"](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20&%20performance/ch1.md) in *You Don't Know JS: Async & Performance*.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like github markdown may not support footnotes. github/markup#498

@pletcher
Copy link
Contributor

Hmmm, I think the footnote issue is all right -- if it seems to get in the way, we can figure out a way to fix it.

This LGTM!

@pletcher pletcher merged commit 1965a00 into master Apr 16, 2016
@pletcher pletcher deleted the wip-master branch April 16, 2016 08:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants