Agenda • All decisions are made in a context • iOS developers are human; we tend to conflate things • Older solutions have value, too • There are benefits to using older technology
Contextual Questions • What technology is available? • How much do I understand the options? What about my team? • How popular is the technology? • How stable are the tools I would need to use? • How easy is it to learn? • How quickly do I need to complete the task?
NSOperation + Blocks • iOS 4+ • Everything from NSOperation, but also with blocks • Less boilerplate • Slightly more verbose than blocks (this is Objective-C, remember) • Not popular – why?
Why GCD? • iOS devs favour GCD over other suitable abstractions • Why? • NSOperation is unfamiliar, feels unnecessary • Not-invented-here-syndrome • Apple is good at marketing
Older Technology • “Old” is stable • “Old” is usually well-documented • “Old” is easy to hire for • “Old” has a lot of helpful resources, libraries, tutorials, etc
NSURLSession • Separate delegates isolate different areas of concern • One object may conform to all protocols • Many, small protocols are better than one massive one • Swift protocols don’t even support optional functions!
NSURLSession • Could have been completely blocks-based… • Instead, based on ideas behind NSOperation • NSURLSession probably wraps an NSOperation, anyway • This is good! No leaky abstractions
Wrap Up • Decisions are made in an unknowable context • Developers are bad at evaluating things • New and shiny things aren’t always better • Old solutions carry extrinsic benefits