Saturday, March 15, 2008

Why Apple doesn't allow multi-tasking on the iPhone

Of all the SDK limitations that Apple imposed on its new iPhone SDK, the one that seems to irk developers the most is the limitation on running background processes. While the ability to run in the background is a fundamental part of programming for Windows or Mac, Apple is trying to make the point that developing for the phone is quite different from developing for a PC. So here are 3 reasons why Apple made the right decision:

1) Its clear that mobile apps should conserve battery and bandwidth. There's an limited upside to multitasking on the phone.

2) Extending the API to include lifecycle management will make the iPhone API more complicated.

3) The network is the computer. Phone developers should make use of the communication protocols built into mobile networks such as SMS, inorder to send and receive notifications.

People are dwelling on #1 but #2 and #3 are more important. The only way to have a large number of high quality, bug-free apps is to have a simple API. Making developers responsible for suspending program execution and persisting program state is really going to increase the probability of bugs. As for communication protocols, it doesn't make sense for independent developers to re-implement them. Your typical GPRS/EDGE/UMTS mobile networks are not really packet-based transports, and designing communication protocols for these kinds of networks are difficult. Apple and the operator will have to standardize on a few communication protocols such as SMS or XMPP, like Google has done with Android.