Why Swift was a better option than Xamarin

swift-hero_2xMatt Baxter-Reynolds over at ZDNet claims that Swift is “a total mishit that’s badly judged the state of the software development industry” and that “What Apple should have done, years ago, was bought Xamarin”. I disagree with this on a number of levels.

I think the crux of the argument hinges on the flawed concept that ‘if only’ Apple supported some sort of standard third party language, it would make switching apps & developers between platforms easy, and everybody wins.  This doesn’t make any sense:

  • Learning a new language only takes a few weeks, however learning frameworks, tools, UI idioms, platform processes and cloud service models takes years. I think there’s an implicit and significant overestimation of the actual benefit to developers of using an existing language.
  • Apple could go further and adopt wholesale a full-stack technology like J2ME or Xamarin, but this would eviscerate their ability to innovate & differentiate their platform. I’m struggling with how this could possibly be attractive to them. There’s a definite sense of entitlement in demanding Apple cripple their business to make it slightly easier for third party developers to add value to competitor platforms.

I’d go further and say the industry as a whole would be negatively impacted by ‘language homogenisation’ — having a single language across all platforms would stifle development of new languages and technologies that work to make the industry better. Would we all genuinely be happier and more productive if Java 6 was the only mobile development language?

A couple of other choice quotes:

When I first heard about Swift I was pleased as I assumed that Apple would look to solve the key problem faced by mobile developers — specifically that there is little overlap between developer toolsets making cross-platform mobile development extremely difficult.

I’m one of those developers and that ‘key problem’ is barely even on my list of problems. If it was, I certainly wouldn’t assume it was Apple’s responsibility to solve it.

No, the problems I battle with most are diagnosing obscure app crashes, dealing with header files, dynamic typing issues, forgetting asterisks, counting square brackets and the like (not to mention f*#!ingblocksyntax). Swift goes a long way towards removing this pain.

It’s been a long time since the software development community accepted commercial, “ivory tower” organisations to dictate engineering approaches. The last time this happened was back in the era that brought us Java and .NET itself. Now the community itself decides.

It should make Matt happy to know that the community itself DOES have the ability to decide — there are plenty of cross-platform mobile dev environments available today, including Xamarin. The fact the community hasn’t decided to replace ‘native’ development with these platforms should prompt him to wonder why (and I don’t believe it’s due to them not being first party).

Oh come on — it doesn’t show the best in modern language thinking at all. Modern language thinking comes from the community, building incrementally within that community in a way that’s genuinely helpful to all of us.

I like to think of programming languages as a window into the general attitudes towards language design at the time they were created. Objective-C is clearly a child of the smalltalk era. .NET was influenced by Java which was influenced by C++. The language elements I see in Swift are a reflection of thoroughly modern  thinking from (yes, community driven) languages like Go, Rust, F#Ruby, Python and Haskell.

It sounds like Matt’s arguing only open source languages have the right to be called ‘modern’, which seems a bit narrow-minded to me.

In essence, Apple had one job — create a new baseline tooling for iOS and show a sympatico approach with how the rest of the industry actually operates — and they blew it.

It looks like he’s called out two jobs there. It’s too early to judge whether they’ve blown the first (and most important) job, but at this stage they certainly appear to have delivered the goods. As for the second, maybe I just don’t understand ‘how the rest of the industry actually operates’, but Platform |> Developer Tools |> Software |> Profit! would be my guess. I get the feeling Matt looked at the language, decided he didn’t like it, and took it as a personal affront Apple didn’t just adopt a language he was already comfortable with.

Lastly, I’ll just add that many commentators questioning the need for Swift seem to be assuming the language selection process was a relatively trivial window-shopping exercise — i.e. “Hey, this one looks nice!” However, that’s oversimplifying the number of factors that needed to be considered, and key amongst those was seamless compatibility with existing C & Objective-C code. None of the existing solutions (like Xamarin) come close to doing this as well as Swift.

 

 

Advertisements

Apps can’t link to the internet

Some App Store reviewers appear to be taking an extremely hard line on review guideline 11.13:

Apps that link to external mechanisms for purchases or subscriptions to be used in the App, such as a “buy” button that goes to a web site to purchase a digital book, will be rejected

One of our apps was pinged for this despite having no purchase mechanism outside IAP, no purchase options on our website, no links to third parties like DropBox, and nothing else other than a couple of PDF download links in app. When asked for clarification, the Review Team responded with:

“remove any links that link out of the app and external links in the application description.”

Apparently linking to ‘The Internet’ might indirectly lead the user to purchase something outside of the App Store. I’d like to think that this is a single reviewer that’s received dud training; if not I expect Apple will need to update 11.13 to explicitly ban external links.

Update: An attempt to clarify whether all external links are in fact banned, or whether the reviewer felt there was an external purchase mechanism buried somewhere on our site, was rebuffed with:

“Thank you for your feedback. If you wish to appeal your review, you can submit a request to the App Review Board.”

GC on iOS

The Whereoscope guys have put up a well-publicised post explaining why they prefer Android development to iOS. One of the main gripes they had was the lack of garbage collection; I felt I had to put forward my take on the GC question.

GC has been available in Cocoa since 2007, and there’s no technical reason (that I’m aware of) that it can’t be delivered as part of iOS. Apple has made an explicit choice to not ship GC in the OS. Without going into too much detail about the trade-offs involved, I think it’s fair to say that when Apple does need to make a trade-off between developer convenience/productivity and user experience, the user will win EVERY TIME. Developers who are expecting anything else are kidding themselves.

Regarding the other points — it’s much the same deal with the provisioning and App Store deployment processes; these are there primarily to deliver a safe, simple, reliable experience for the users. Criticisms of the documentation and XCode are subjective, but probably not too far off the mark. I did find the complaint about the Simulator as being ‘too fast’, in comparison to Android’s emulator (too slow to be usable, but this is somehow a good thing) to be quite odd.

Mac App Store

Just a quick observation on the newly announced Mac App Store: I found the most interesting thing about the app store is what it isn’t — it isn’t iTunes. This would be mostly due to the fact a Mac app store wouldn’t make much sense in  iTunes for Windows, but perhaps it marks the beginning of the end for iTunes as Apple’s universal delivery mechanism for content?