Workshop: Async Programming in JS: The End of the Loop

Location:

Level: 
Intermediate
9:00am - 4:00pm

Date:

Fri, 17 Jun

Key takeaways

Declaratively build complex events out of simple events (ex. drag n' drop)
Coordinate and sequence multiple Ajax requests
Reactively update UIs in response to data changes
Eliminate memory leaks caused by neglecting to unsubscribe from events
Gracefully propagate and handle asynchronous exceptions

Prerequisites

Laptop with a modern browser installed

Learning how to build and manage asynchronous programs is perhaps the most important part of becoming an effective JavaScript programmer. Unlike most programming languages, JavaScript is single-threaded. As a result, JavaScript programs must use async APIs to stay responsive to user input while performing long-running tasks like server requests and animations. You can't get very far in a JavaScript program without running across an asynchronous API.

Async programming may seem daunting. How can we write programs that accept user input, run animations, and send server requests over the same period of time? How do we keep the code clear and concise? How do we gracefully propagate and handle asynchronous errors? How can we avoid memory leaks caused by dangling event handlers? JavaScript's loops and try/catch keywords are no help - they only work on synchronous functions.

Here's the good news: Asynchronous programming is much easier than it seems. The key is to think differently about events. It is possible to build most asynchronous programs using a handful of simple functions. We will learn why most JavaScript developers approach asynchronous programming the wrong way, and how to avoid these common mistakes. By the end of these lessons you will know the tools, concepts, and libraries required to be an asynchronous programming ninja!

In this section, we'll learn the first secret to mastering asynchronous programming:programming without loops. JavaScript's loops can only run synchronously, and cannot be used to repeat asynchronous functions. As a result, in order to master asynchronous programming we must first master programming without loops. In this series we will learn how to program Arrays without loops using just a few simple functions.

Speaker: Jafar Husain

Tech Lead/TC-39 Representative @Netflix

Jafar Husain is the Cross-Team Technical Lead for the Netflix UI's. He is the architect of Netflix's UI data platform, and specializes in building reactive, event-driven systems. A highly-rated speaker, he has spoken at QCon, HTML Dev Conf, QCon, CodeMesh, YOW! and given Channel 9 interviews. He has also trained hundreds of developers to build event-driven systems in JS. He is the Netflix representative on the JavaScript standards committee (TC-39) and is actively working to evolve the JavaScript language.

Find Jafar Husain at

Tracks

  • Architectures You've Always Wondered about

    Case studies from the most relevant names in software

  • Developer Experience: Toolchain, Continuous Delivery, & More

    Trends, tools and projects that we're using to maximally empower your developers.

  • DevOps & Site Reliability

    Failures, edge cases and how we're embracing them.

  • High Velocity Dev Teams

    Working Smarter as a team. Improving value delivery of engineers. Lean and Agile principles.

  • Immutable Infrastructures: Orchestration, Serverless, and More

    What's next in infrastructure. How cloud function like lambda are making their way into production.

  • Innovations in Fintech

    Technology, tools and techniques supporting modern financial services

  • Machine Learning 2.0

    Machine Learning 2.0, Deep Learning & Deep Learning Datasets

  • Microservices: Patterns & Practices

    Practical experiences and lessons with Microservices

  • Modern Clientside Apps

    Reactive, cross platform, progressive - webapp tech today

  • Modern CS in the Real World

    Applied, practical, & real-world dive into industry adoption of modern CS

  • Next Gen APIs

    Tooling, techniques, & practices building APIs today

  • Optimizing Yourself

    Maximizing your impact as an engineer, as a leader, and as a person

  • Security War Stories

    How our industry is being attacked and what you can do about it.

  • Stream Processing in Practice

    Rapidly moving data at scale.

  • Today's Java

    Lessons from 8, prepping for 9, and peeking ahead at 10. Innovators in Java.