Wednesday 22 October 2014

iOS and Xamarin

Deciding between native iOS and Xamarin (MonoTouch)

An old friend of mine, who I worked with back when I was a .NET developer, emailed me recently. He was looking for some advice on which platform to use for creating iOS software, mostly focusing on native versus Xamarin (MonoTouch). My answer does not delve into specifics about Xamarin, because it’s been years since I used their platform in earnest. It does, however, express my opinion on native vs. non-native. He left out other options, such as PhoneGap, perhaps because he simply was not yet aware that they exist.
Below is his email, followed by my reply. I don’t expect this to settle the matter once and for all (where’s the fun in that?!) but perhaps it will give others a new perspective on the topic.
His Question
Since I have started playing around with iOS, two questions that came to my mind and I thought I should ask you.
To be or not to be native iOS?
Xamarin or not to Xamarin?
My real purpose is
  • to create some productivity apps for handheld devices and
  • to create some re-usable control libraries.
It will be great if you can share your expertise on this :-)
My Reply
Your question is a good one, which I’ve discussed with many people. So far my answer is broken down into three considerations:
  1. Reach – Is getting the same codebase onto as many devices as possible a high priority, or are you more interested in keeping the app on one operating system for the first launch (in order to create the best app possible – no compromises)?
  2. User Experience – Are you willing to make sacrifices in the user experience to use a non-native layer (ex. building HTML-based UI via PhoneGap)?
  3. Budget – Can you afford to build a separate app for each platform? If so, that’s probably the best route since you won’t need to rely on lowest common denominator solutions that bring their own bugs and limitations to the table.
In your particular case, the re-usable control libraries should be native because I doubt that such performance-sensitive, low-level rendering code would be reusable via Xamarin’s platform across different OS’s. You can always wrap your native libs with their runtime wrapping API, which I read about a while back, and use them from Xamarin apps if necessary.
Regarding the productivity apps, I don’t know enough details about your situation to say anything definite. Using Xamarin for those apps might make sense, and you will probably have a temporary advantage of avoiding the learning curve associated with native iOS programming (note: I wrote temporary). Truth be told, learning native iOS programming isn’t all that difficult, it just takes time and a little brain rewiring. Also, when working with Xamarin, or PhoneGap, you often end up dealing with Objective-C code anyways (plug-ins, StackOverflow examples, etc).
I have a bias toward native since it is inherently better than any 3rd party layer, and I’m not interested in dealing with the bugs of Apple and another company as well. Unfortunately, technical preferences don’t usually drive business decisions!

No comments:

Post a Comment