Monday 11 January 2016

Why Xamarin?

These days, I am investing my time and money into studying Xamarin. If someone told me a year ago that I would be doing this, I wouldn’t believe them. And yet here I am, a student of Xamarin University. Why?

Reason 1. I am sick and tired from stretching myself between the two major mobile platforms, and from having absolutely no time left for the third, maybe not so popular but still very interesting platform. I started developing for iOS (at that time iPhone SDK) back in 2008. Since I have a Java background, it was natural for me to adopt Android as well, as soon as it appeared. For several years since then I endured the struggle to keep myself up-to-date on both platforms. It was a lot of fun, but these days an idea like that is just an utopia. Although visually iOS and Android come closer and closer to each other, from the development point of view they are very, very different, each of them moving with an increasing speed in its own direction.

Reason 2. Swift. I would actually suggest to call it Slug, it would be more appropriate, as it is so sluggish. I was present at its birth, as I was an attendee of WWDC 2014 when Swift was announced. At first it looked like a good alternative to the old friend Objective-C. It still does. However, the way how Apple is approaching the development of the new language is quite horrible. Here is just one example: I completed a project in June 2015 using a version of Swift that was current then, 1.2. In November, when handing over the code, I tried to compile it and got 64 errors. The only reason was that the current version of Swift was then 2.1, and a large number of breaking changes was introduced. Most of the errors were about me using the old ‘println’ rather than the new ‘print’. I should also mention that Xcode is becoming buggier and buggier, approaching Eclipse in this respect, whereas Intellij-based Android Studio is doing quite well.

The bottom line is that if you want to use Swift, you need to keep learning it all the time, updating yourself to the most recent version of the language, and updating your code every few months in order to not break. Quite a crazy endeavour, especially if you attempt to be able to develop for Android as well. And now there are rumours that Android will adopt Go in place of Java… Of course, there is an option to completely ignore Swift and to stay with Objective-C, but then you won’t be competitive on the jobs market. In this situation, a single language development environment, like Xamarin, is becoming more and more attractive. After all, C# isn’t that different from Java, and if it is different then in a good way. To be honest, when I worked as a Java developer, I wished I could use C# instead, and I played with the language in my free time.

Reason 3. My CV. When in 2010 I was insisting on creating an Android version of the British Gas app, I thought that my ability to develop for both platforms will give me an edge on the jobs market. I was very wrong. A typical potential employer, when looking for a contractor, prefers to have a one-trick-pony. And that’s understandable: a contractor is a disposable resource. So when I submit my CV for an iOS position these days, it looks ridiculous, as it has a lot of Android stuff in it, and vice versa. A potential employer believes that if I can develop for both platforms then I can’t do it well for any specific platform.

I believe that with Xamarin my versatility will stop being a problem. After all, there is Xamarin.iOS, and there is Xamarin.Android, and to get a Xamarin certification you are supposed to know both. Sounds good to me. So I am looking forward to adding the Certified Xamarin Mobile Developer badge to my CV.

Reason 4. My hobby apps. I submitted to the App Store my very first iPhone app, iLuna, in February 2009, and it was doing well for a number of years, with a few minor updates along the way. When iOS 8 was released, it just stopped working. Of course if I really cared about the app, I could test it with a pre-release version of iOS, but I didn’t. I have so many other things to do that if something works I just don’t touch it. And then there were a few months of agony when I was rebuilding iLuna from scratch. That’s for iOS. iLuna for Android keeps working all these years, with all those changes to the platform, but it looks really old, and it was actually never developed to the same degree of sophistication as the the iOS version. I just don’t have enough time.

I have a similar situation with my second most popular app, Hours. The Android version of it is old and tired, and I don’t have time to complete the new version for iOS either. These are two different jobs. Where do I find time for them?

In fact, I have about a dozen of different hobby apps on the iOS side, and only a few on the Android side. It just so happened, because Android Market (now Google Play) was underperforming for years. It is better now, but again there is no time to create the dedicated Android versions of all of my apps.
And now meet iOS 9. As soon as it was released, I started receiving messages saying that a number of my less popular apps, which kept just working for years, do not work anymore. Oh, thank you, Apple! Now I need to find time to fix those apps too. Yeah…

In addition, I always wanted to re-create my apps for Windows Phone as well. I even have a Lumia phone waiting quietly in the corner as a would-be test device. But unfortunately I never managed to find time to learn properly yet another mobile platform. What a shame.

Now, with Xamarin.Forms, I have a fighting chance to re-create all my hobby apps, and to have them for all three platforms at the same time, with the same feature set. Looks like a really attractive proposition for me. And I am already working in this direction.

One of the challenges for me when learning Xamarin was that I need to know C# properly. I did know some of it in the past, but the language keeps developing, and I need to be thoroughly familiar with its most important features. So in addition to the posts describing my Xamarin journey, I decided that I will use this blog to summarise my C# learning experience. Just to keep all the findings in one place, and to be able to easily review them. It’s going to be a series of posts under a header like “C# for Java Developers”. Stay tuned, if you are interested.

No comments:

Post a Comment