A Promise for a Better Future – Ben Scheirman
Synchronous code is easy understand. Inputs and outputs. It's easy to chain together. When you need to go asynchronous the model shifts. Typically you start using completion handlers or delegation, and then the code isn't quite as easy to reason about as it once was. You start passing around closures of different types, have error handling in multiple places, and the nesting becomes quite tedious. Worse, when you have to add things like retry, timeout, recovery, and concurrency things can get really tangled and be a source of bugs. In this talk we'll examine how Promises can turn your asynchronous code into something a little easier to work with, allowing you to compose asynchronous operations with ease and supporting advanced concepts in a clearer way. This talk will also examine a possible future of Swift where async/await is a reality.