by lanestp · 10y ago · 0 comments
The real problem is that I can write a native iOS app in a fraction of the time it took to write a Xamarin app. Swift has improved iOS development speed so much I'm not convinced we need cross platform app engines (excluding games).
As for Android, yeah, native Android sucks. Activities and fragments are the worst idea anyone has ever had and no one agrees on best practices. But even with cross platform high levels of abstraction like Unity3D you still need to understand them. So, my current advice is to suck it up and write it native twice. Pick your favorite OS, start with that, and then port the logic.
2 years ago, Xamarin was buggy as hell. Today, (IMHO) it's quite stable.
Edit: downvoted for sharing my experience? Stay classy, HN.
/s silicon valley reference
I think the code sharing thing really comes down to how you're using Xamarin – if you keep on writing apps the way you're used to from the original platforms, there's not much to gain. On the other hand adopting the patterns and ideas that influence the .NET sphere (DI/IoC, MVVM..), Code Sharing rates (or PCL vs. Native LoC) can be as high as 80/20.
Xamarin Studio certainly has its own shortcomings, but both Microsoft (Visual Studio for Mac) and Jetbrains (Project Rider) are actively improving or developing alternatives, so I think that pain is going to fade over time.
If you are using basic Xamarin then you will end up writing separate UI code for each platform, but you can still share business logic if you architect if well. Xamarin.Forms is different and lets you share the UI too.
Even with Forms, you will always have some platform specific code, but this is normally small. For example, some implementation details when using SQLite.
[0]: I'm writing about this starting with https://unop.uk/cross-platform-native-mobile-app-development...
If your app is just a mobile front-end for a REST API then I wouldn't bother with it: develop two versions of the app with different UI idioms.
If your app does something considerably more complex, Xamarin might also be a good idea. Keeping two drastically different codebases in sync can be a very big task, but I suggest proactively looking at issues people have experienced with it, as well as other differences such as memory management which works very differently to what you're used to as a .NET developer.
However I think a number of responses have strayed from the question, which is "is it worth learning Xamarin". It appears Microsoft bought the technology because it was useful, not to kill it. I don't think the technology will be retired any time soon and can only get better. So long as Microsoft gives this the TLC it needs, it will be a formidable part of any developer's toolkit.. so long as it can get over the really bad reputation it has.
I for one will explore every possible alternative before considering Xamarin again.
That was the thing that struck me the most when following a Xamarin course. I just don't see the added benefits of Xamarin when you are at that level of using (or having knowledge of) native code.
Yep, you will keep hearing this from people complaining of Xamarin. A huge problem indeed, and I'd say enough for it not be worth learning.