fabián cañas

What's Exciting About ResearchKit


Earlier this week Apple announced ResearchKit.

ResearchKit is an open source framework introduced by Apple that enables your iOS app to become a powerful tool for medical research.

It appears to be the first time Apple will open-source code that’s close to the Application layer. I want to see what high-level, modern, production-ready Cocoa Touch code looks like when it’s written by Apple.

Apple does have its fair share of open source projects and contributions. Most of them, like WebKit, Bonjour, and contributions to clang are infrastructure or ridiculously complex, highly optimized code. None of Apple’s open source resembles a modern Cocoa or Cocoa Touch Application.

When I was first learning Cocoa, it seemed like most of the sample code I could get my hands on was the bare minimum code necessary to show how to use an API. Example code like that makes a lot of sense, but maybe contributes to the widespread practice of monstrous view controllers. The few sample applications that did exist seemed to embrace the idea that “concerns” in “separation of concerns” are user-centered tasks instead of finer-grained logically separable components that are easier to compose and recombine.

Recently, code samples available to to developers include apps that we might be able to learn more from than basic API usage: Adventure, Lister. There’s a good one one demonstrating how to structure data sources for collection views too. And the last couple of WWDCs have started including talks on how to organize an application and manage complexity.

I’ve learned a ton from Apple’s Frameworks about framework architecture and API design just by reading and really understanding the headers and APIs. But I’ve never been able to look under the hood before. I hope to get a glimpse with ResearchKit.

Of course, the societal benefits that ResearchKit could bring are huge. Maybe a little less exciting to me, but it does make me feel warm, fuzzy, and more optimistic about the future of humanity.

Update March 16, 2014

While I was writing I remembered that the source code to TextEdit is available to developers as sample code, as is a drawing app called Sketch. When I first encountered these examples, they went over my head. Now they look like good code to study. They are, however, not open source. If anyone is going to analyze, criticize, or improve on them, I believe it will have to be in private.