Xamarin and Microsoft announce a partnership to make it easier to use C# to build mobile apps for all the big platforms

microsoft - xamarin

I’m very pleased to hear about the partnership that Microsoft and Xamarin announced today, which brings together the company behind the C# programming language and the company who make it much easier to use it to write apps for platforms beyond Microsoft’s. This is good news for people who like the C# programming language — and there’s a lot to like — but who also want to develop apps for iOS and Android.

The first three results of this partnership will be:

  1. Truly Portable Class Libraries –  Portable Class Library (PCL) projects will now be fully supported on both iOS and Android, making it easier than ever for C# developers to share code across devices. Code common to all platforms can stay in a single, central project and then referenced from platform-specific code in the same solution, whether Android, iOS, Windows Phone, or Windows Store. PCL project references will allow developers to bounce back-and-forth between PCL and platform-specific projects.

  1. Support for Visual Studio 2013 – Xamarin and Microsoft released significant improvements to Xamarin’s Visual Studio extensions, as well as support for Visual Studio 2013, and more integrations have been promised.

  1. Special offers for MSDN Subscribers – Microsoft and Xamarin have created special offers for MSDN subscribers, including special pricing on new purchases of Xamarin, extending the trial period from 30 to 90 days, and free training from the newly-announced Xamarin University.

This is great news, because…

C# rocks!

For all the things that are wrong about Microsoft, there has consistently one thing that’s been right about them since 2000: the C# programming language.

Started as “Project COOL”, where COOL was an acronym for “C-like Object-Oriented Language”, C# was meant to be Microsoft’s answer to Java, with the ability to interoperate with COM, Microsoft’s Component Object Model, the binary interface standard that underlay a lot of Microsoft technologies, including OLE, ActiveX, Windows Shell, Windows Runtime, and DirectX. When it first started, C# was always playing catch-up with Java, but over the past few years, and most notably with the release of C# 3.0, it’s Java that’s being left behind in terms of language features and expressiveness. This list posted on Stack Overflow does a pretty good job of laundry-listing where C# beats Java:

  • Closures;
  • Runtime generics;
  • Generics of primitive types (benchmarks of this sorting a list of a million ints vs a million Integer objects have revealed a factor of 3 improvement);
  • Delegates;
  • Events;
  • LINQ;
  • Extension methods;
  • First-class properties;
  • Operator overloading;
  • Indexers;
  • Anonymous types;
  • Expression trees;
  • Using blocks;
  • No checked exceptions. Hooray!
  • Decimal type;
  • As of C# 4.0: the dynamic type, which is basically duck typing.

I’ve been doing some noodling with Java while teaching myself Android programming, and having come from the world of C#, Java feels so ghetto. I’m going to have to do some noodling with Xamarin’s tools now!