Steve Kinney

Actually Understanding Asynchronous JavaScript

Steve Kinney

Twitter
@stevekinney
Bio
Steve is a principal engineer at SendGrid where he works on creating a rich WYSIWYG editor for building HTML emails using modern web technologies. Previously, he was the director of the front-end engineering program at the Turing School of Software and Design in Denver, Colorado where he taught JavaScript and other technologies to aspiring developers from across the country. He is a recovering New York City public school teacher and recently learned how to drive a car.
Talk Description

Reasoning about asynchronous code can be hard if you don’t understand the mechanics. It often trips up programmers with deep experience in other languages when they try their hand at client or server-side JavaScript. But, asynchronous JavaScript isn’t as hard as it seems once you learn a few simple rules about how it works. In this talk, we’ll dive into the mechanics of concepts that you might have had a chance to full grok.

Let’s dispel this confusion once and for all. We’ll explore some metaphors that illustrate the difference between how synchronous and asynchronous code execute. In a 30-minute tour de force, we’ll dive into essential concepts like the call stack and the event loop to build a solid conceptual understanding of how the asynchronous model is implemented. We’ll take a good hard look at a number of common patterns for writing asynchronous code in JavaScript. We’ll start with listening for events on XMLHttpRequest before abstracting that mess with callbacks and promises. We’ll pull back the curtain and see that async/await is really just a cocktail of promises and generators. Finally, we’ll lightly touch upon some more boutique approaches like CSP and shooting messages back and forth between the main and worker threads.

Register for NEJS CONF

Full Speaker List