dwyl / learn-javascript

A Series of Simple Steps in JavaScript :-)
Other
64 stars 15 forks source link

Asynchronous Adventures in Javascript by Benjamin Diaguid #27

Open YvesMuyaBenda opened 7 years ago

YvesMuyaBenda commented 7 years ago

A really, really nice detailed but understandable discussion of the whys and whats and hows and wheres of asynchronous Javascript code, which has previously been to me nothing but dark magical arts:

  1. Understanding the Event Loop: https://medium.com/dailyjs/asynchronous-adventures-in-javascript-understanding-the-event-loop-fc6f968d5f72
  2. Callbacks: https://medium.com/dailyjs/asynchronous-adventures-in-javascript-callbacks-39880f1b470e
  3. Promises: https://medium.com/dailyjs/asynchronous-adventures-in-javascript-promises-1e0da27a3b4
  4. Generators: https://medium.com/dailyjs/asynchronous-adventures-in-javascript-generators-74199218bab2
  5. Async/Await: https://medium.com/dailyjs/asynchronous-adventures-in-javascript-async-await-bd2e62f37ffd

The above gives me courage to have another crack at chapter 17 of "Eloquent Javascript", since I now have more context and googable terms.

'@nelsonic I think you might find the discussion on callbacks useful for your "Elm Architecture in Javascript" tutorial, given that it was assumed the audience might not be familiar with the callback pattern. I myself was aware of delayed evaluation from functional Programming (thunk) but did not quite connect the concept of delayed evaluation with asychronicity, so I get two apples for the price of one!: oh, it is called a callback becauses the function will be called later, depending on whether it has finished its work, or is just needed right now!

newswim commented 7 years ago

Can't wait to read through all of this. Thanks Yves!

Here's another on the event loop, What you should know to really understand the Node.js Event Loop.

YvesMuyaBenda commented 7 years ago

@newswim Thanks for your reference. I shall be reading it very very shortly, Oh, and I have been meaning to share with you this cool Evernote blog on Feynmann: https://blog.evernote.com/blog/2017/07/21/learning-from-the-feynman-technique/

newswim commented 7 years ago

Perfect! Having a mental-model for learning will definitely help me to grok more of this material. I've been reading the lectures on physics, very eye opening đź‘€