Recently a colleague of mine made me aware of this eye-opening presentation by Jafar Husain of Netflix on Asynchronous JavaScript. He talks about how each event triggered can be treated as an item in a collection, making it straight-forward it implement fairly sophisticated asynchronous behavior. However, this style of programming has implications on how you might be using JavaScript.

Jafar talks about the need to learn map, reduce, filter, mergeAll and zip functions to be able to write JavaScript code in a more concise, readable and maintainable way. He does an excellent job of laying the arguments and providing an interactive tutorial on his Functional Programming site.

In the video below, Jafar talks about the Reactive Extensions for JavaScript which enables developers to treat events like collections. In essence removing memory leak concerns caused by dangling event handlers. He further explains how this was of thinking brings the provider-consumer pattern inline with the iterator pattern.

You can download Reactive Extensions right here.