This event has ended. View the official site or create your own event → Check it out
This event has ended. Create your own
View analytic
Friday, June 7 • 4:00pm - 4:50pm
Asynchronous Javascript - Callbacks Are So Old School -G10

Sign up or log in to save this to your schedule and see who's attending!

Javascript developers can’t get enough of callbacks. It’s been our tried and true workhorse when dealing with asynchronous code since the dawn of ajax and the rise of jQuery. With the advent of nodejs, we’ve taken things to the extreme. Now, if we want to make a database query, respond to a web server request, or make a rest call to a web service, we need deeply nested callbacks in order to achieve what we need. In time, this phenomenon becomes the pyramid of doom, where we need 500 character of horizontal screen width to read all of our code. The issue here isn’t that we are using asynchronous code, but rather that we aren't using the best design pattern for the job. I’d like to talk through a relatively new paradigm for control flow in javascript, the deferred. Using this technique, you can develop an much more straightforward asynchronous javascript application. Not only is it a way to remove the need for callbacks, but it opens a door to new design possibilities, without the complexity of continuation passing style. Rather than passing all of our callbacks as arguments, we will take a higher level, and more functional approach, by creating a system that expects promise objects to eventually produce data, and we manipulate that data expecting that it will exist in the future.

avatar for John Paul

John Paul

VP of Engineering, Avagen Ventures

Friday June 7, 2013 4:00pm - 4:50pm
Room 106
  • Session Code G10

Attendees (31)