Live data from Hacker News

Ask HN: Is Xamarin worth learning?

news.ycombinator.com

51–60 of 168 posts

Re: Ask HN: Is Xamarin worth learning?

#51
post #25

Isn't Facebook for Android built in React Native? Doesn't seem to be lacking for them. Airbnb and Instagram [1] are also doing alright. https://facebook.github.io/react-native/showcase.html

I think mainly for minor parts.

From my initial research it appears the React Native on Android suffers performance problems. I.e. the Discord app on that showcase is still native Android, whereas their iOS app is React Native.

Re: Ask HN: Is Xamarin worth learning?

#53
post #35

I've been extremely disappointed in Xamarin. The main issue is that you don't really get code sharing. I would estimate that only 25% of the Xamarin project I manage is cross platform code. The rest is this bizarre merger of native APIs with C#. It's difficult to write because of the lack of examples and documentation. It's also buggy, even with simple things like page views. The real problem is that I can write a na…

> I would estimate that only 25% of the Xamarin project I manage is cross platform 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.

Re: Ask HN: Is Xamarin worth learning?

#54
post #35

I've been extremely disappointed in Xamarin. The main issue is that you don't really get code sharing. I would estimate that only 25% of the Xamarin project I manage is cross platform code. The rest is this bizarre merger of native APIs with C#. It's difficult to write because of the lack of examples and documentation. It's also buggy, even with simple things like page views. The real problem is that I can write a na…

"The rest is this bizarre merger of native APIs with C#. "

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.

Re: Ask HN: Is Xamarin worth learning?

#55
post #35

I've been extremely disappointed in Xamarin. The main issue is that you don't really get code sharing. I would estimate that only 25% of the Xamarin project I manage is cross platform code. The rest is this bizarre merger of native APIs with C#. It's difficult to write because of the lack of examples and documentation. It's also buggy, even with simple things like page views. The real problem is that I can write a na…

Hm, completely different experience here. I've been involved with three rather large Xamarin-Projects in the last year, and we were (team-wide) completely surprised at how much of the code can actually be shared, how our velocity compared to native development and the overall dev experience. 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…

I think it's going to entirely depend on what type of app you have. Much like your parent comment, my experience with building an app was that very little code could actually be shared. In my case we had some fanciful design that would largely have to be custom code for each platform. Thinks like API calls, validation, business logic could be shared but that was negligible compared to the platform specific code.

Re: Ask HN: Is Xamarin worth learning?

#56
post #35

I've been extremely disappointed in Xamarin. The main issue is that you don't really get code sharing. I would estimate that only 25% of the Xamarin project I manage is cross platform code. The rest is this bizarre merger of native APIs with C#. It's difficult to write because of the lack of examples and documentation. It's also buggy, even with simple things like page views. The real problem is that I can write a na…

I've had completely the opposite experience. Have worked on several medium-to-very large Xamarin projects (4 developers up to 60 developers) and rarely have I seen code sharing drop below 50%, with the sweet spot being around 60%.

2 years ago, Xamarin was buggy as hell. Today, (IMHO) it's quite stable.

Edit: downvoted for sharing my experience? Stay classy, HN.

Re: Ask HN: Is Xamarin worth learning?

#57
I couldn't get React Native working for Android (on either Mac or Windows) but I've been pretty happy with Xamarin. I've written a simple game in Xamarin.Forms that I will be posting about.

Purely by coincidence, I have four blog posts on this out this week. The first one (on React Native and Xamarin) is here: https://unop.uk/cross-platform-native-mobile-app-development...

Re: Ask HN: Is Xamarin worth learning?

#58
post #35

I've been extremely disappointed in Xamarin. The main issue is that you don't really get code sharing. I would estimate that only 25% of the Xamarin project I manage is cross platform code. The rest is this bizarre merger of native APIs with C#. It's difficult to write because of the lack of examples and documentation. It's also buggy, even with simple things like page views. The real problem is that I can write a na…

It depends. I've been pretty happy with Xamarin for what I'm doing (a game [0]).

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...

Re: Ask HN: Is Xamarin worth learning?

#59
I've used in production and experience was good. Xamarin Studio is more than enough for development / debugging. Xamarin is very powerful, but usually people taking the wrong direction with Xamarin and using Xamarin.Forms. As like many other cross platform solutions Xamarin.Forms sucks. If you think making a native iOS application is easy with Swift, it is same with Xamarin too. When i develop applications with xamarin (desktop/mobile) i usually look for java/swift documentations or forums for my problems. This way i don't need separate xamarin community. Because you can write the same code in c# easily. Please check my workflow, for any further questions, twitter: @umurgdk

Recommended workflow: 0. Never ever use Xamarin.Forms other than quick prototyping. If you develop applications with other cross-platform frameworks, you already know all of them sucks and Xamarin.Forms is not an exception.

1. Create PCL / Shared project for your business logic (also your view models if you're using MVVM architecture). Believe me most of your application is platform independent (except the view layer). Your api communication, storage operations all handled here. See 3rd article to how to make storage/network platform independent.

2. Create native projects for each platform (iOS, Android, Windows) implement native views here (use xcode, android studio if you need visual designer). This part should be exactly the same as your swift/java code. For iOS you're just implementing an ApplicationDelegate class and UIViewControllers as same as your swift code. Same for Android part, nothing special to xamarin just implement your activity classes. At this level you have the full power of your native platform with one exception 3rd party native libraries. It's possible to use (yes i used some swift/java libraries for youtube player) them but really hard to integrate to your project, that part has to be improved and better documented.

3. Your shared code base need native features, for example storage implementations are totally different for each platform, or changing views (navigation) will be implemented differently for each platform. Since shared code base shouldn't know anything about native platform. You should abstract these functionalities with interfaces. For example create a storage interface with methods like saving/reading/creating files. Another example might be network communication. Abstract it as an interface on your PCL and implement this interface in your native project with full control of your platform. Your shared code base only knows how to use that interface. And then each of your native projects should implement these interfaces. At this point dependency injection may help to register implementations easily. Actually that part is what makes you share your business logic. Writing idiomatic cocoa navigation code is much better than using any cross platform implementations, you have full control but in the same time your shared code base using them without knowing anything about the platform.

Re: Ask HN: Is Xamarin worth learning?

#60
post #35

I've been extremely disappointed in Xamarin. The main issue is that you don't really get code sharing. I would estimate that only 25% of the Xamarin project I manage is cross platform code. The rest is this bizarre merger of native APIs with C#. It's difficult to write because of the lack of examples and documentation. It's also buggy, even with simple things like page views. The real problem is that I can write a na…

I've had completely the opposite experience. Have worked on several medium-to-very large Xamarin projects (4 developers up to 60 developers) and rarely have I seen code sharing drop below 50%, with the sweet spot being around 60%. 2 years ago, Xamarin was buggy as hell. Today, (IMHO) it's quite stable. Edit: downvoted for sharing my experience? Stay classy, HN.

Don't worry about strange downvotes. Nothing attracts upvotes faster than an initial downvote. Lots of people will upvote an unfairly grey comment that they normally wouldn't have upvoted. So it's quite likely that you'll end up with more upvotes than you otherwise would have.
Post reply on HN