Visual Studio for Mac (Xamarin), or Just Go Native?

Here’s an internal debate that’s been going on in my mind for some time now:

Should I continue getting deeper into Xamarin, or should I learn Swift, maybe Java, and do the full native thing?

I have been learning Swift and I really like it, but, I still can’t totally get behind full native. For now, as I start to specialize in mobile development, I can’t talk myself out of using Xamarin. And I’ve tried.

Native is Limited

This is counter intuitive, but I believe that there’s a significant disadvantage to using one of the native platforms. Let’s say I decide to continue learning Swift, get myself deep into iOS development and specialize there. I would have the advantage of being a “real” iOS developer, yes. I’d be using all of the native tooling and get that whole experience.

But, and this is a big but, I would only know iOS. If I have a client that wants an Android app, I’d either have to start from scratch learning Java (which wouldn’t be super hard), learn the tooling, the API’s and Play Store ecosystem, etc. That’s a huge investment. And let’s say it’s the same app, same functionality. I couldn’t reuse anything. Nothing would be reusable.

In all likelihood, if you’re going to be a mobile developer, you’re going to pick iOS or Android and stick with your platform of choice. A nice project comes up that’s on the other platform, you send that client to someone else. Lost opportunity? Yes. But so what. Other gigs will come along that fit your specialty.

Native has Advantages

I’m not saying that full native, picking a platform and sticking with it, is a bad thing. It’s not. There are some serious advantages there too. For instance, specialization. You’ll likely be more hirable as a specialist in Android development than a jack of all trades in cross platform (more on that below). You’re going to know that platform inside and out and that’s a good thing.

Another benefit of native development is the support. If you have a problem and post it on StackOverflow, you’ll get answers in the language you know. No need to translate from Swift to C# for example. You’re using the tools that the platform recommends and not some 3rd party kludge that has weird issues from time to time. Pick a platform, use the tools and get the whole experience. That’s nice.

Why Stick with Xamarin?

One Language

Like I said, this little debate has been going on in my interior monologue for quite some time now. Every time I come back to Xamarin. Why? There are a few reasons but let’s get the easiest reason out of the way early: C#. I love C# and the fact that I can use it to write apps with 100% API coverage for iOS, Android and Windows is awesome. But, beyond that, I get to use all of the niceties of C# as well. Things like LINQ. There’s nothing quite like LINQ.

But yeah, I already know C# so that helps. Am I just settling for what I already know? Am I just unwilling to learn a new language? Nope. I’m still learning Swift and plan to continue. An unwillingness to learn is not my motivation for sticking with C# and Xamarin. In fact, I think learning a new language is one of the best ways to expand your skill-set. Since I started learning Swift, I’ve ended up learning more about C# than I would have otherwise. It’s weird, but it’s true.

So, yeah, one language that works on all platforms. It’s hard for me to make that case that I should learn another language and then limit myself to it when I could take the language I know best and apply it to all 3 platforms. I just can’t justify that. And, even if I didn’t know C#, I would likely learn it just so I could target all 3 platforms.

Cross Platform

This is of course, the major selling point of Xamarin, and for good reason. It’s true, you can write cross platform code, share a large percentage of that code among platforms and create beautiful native apps. Using Xamarin Forms, you can share about 90% of your code among the 3 platforms. Forms has limitations, but there are many use cases that can get away with using it.

I still have to learn the iOS, Android and UWP API’s (and the ecosystems). The details of each platform is not something you get to bypass, but I mostly only need to know the view-level stuff because most of my business logic is shared. For instance, I don’t have to deal with CoreData because I can use a SQLite library and avoid that whole mess. Most recently, I can even use Realm now that they support Xamarin. When I use something like MVVMCross, I get to share even more of my code and use data binding on all 3 platforms too.

Specialization

Earlier, I talked about specialization in iOS or Android as an advantage. And it is. But I think in the near future, specializing in Xamarin might become an even better specialization. Freelance clients could care less about how I build their app. But if I tell a client I can build their app for iOS, Android and Windows at a significantly lower cost than doing those all fully native, that client will likely hire me. Cross platform is a speciality too. The same goes for employers, particularly in the enterprise. A single platform developer vs. a cross platform developer is a no-brainer for the enterprise.

Conclusion

I’m not saying it’s all wine and roses with Xamarin. It’s rough sometimes. The tooling can be problematic, you have to translate Objective-C samples to C# from StackOverflow and there are problems with Xamarin Studio and the Visual Studio integration. I can live with those problems. Xamarin allows me to do something that no other toolset can and I think it’s only going to improve with time. This is the debate that’s been rattling around in my mind and I always come back to Xamarin because it just makes sense for me.