Hacker News new | ask | show | jobs
by natfriedman 4932 days ago
Yes, but write-once-run-anywhere solutions deliver mediocre user experiences on every platform. You don't want your Mac app to look anything like your Windows 8 app. With Xamarin you separate the presentation layer of your app from the rest of the app, and the only thing you're rewriting from platform to platform is the UI. Typically this is only about 25% of the code (though of course it can vary). This is how our customers do it on Android, iOS and Windows, and now they can extend their apps to Mac and still deliver an amazing Mac app.
3 comments

Not every app has to be beautiful and super-usable though (most business/productivity apps).

If an app can achieve 80% of the usability cross-platform without doing much tweak, I'd say that's a good investment from the publisher perspective.

Agreed, not every app has to be done in that way, and for that there are plenty of alternative solutions.

From HTML to Java, to Gtk# and a dozen more.

This is a set of tools for developers that need to take advantage of native APIs, either for the UI, accessing the advanced audio features in OSX, accessing Darwin features, integrating with StoreKit, iCloud, Apple's OpenGL extensions, SceneKit, Bluetooth and those sorts of things from C#.

I agree with you, but for native development, I think I'd rather use a native language---something compiled like Go or D. I do love C# and Python for my own home projects, but for apps that I distribute to others, I don't want to have to ship half of my computer with my app. I'd like to separate logic from UI, write the shared logic, add a platform-specific UI (calling native OS APIs), add a few platform-specific features (provided by the native OS) so no platform-exclusive competitor has any advantage over me, compile and statically-link (only what I need, not a massive runtime) and ship. Like language localization, this process would be repeated for each attractive platform---small, fast, fully native on each platform but with most of the code shared across platforms.

You can do this today with C, but I'd sure rather work in something more modern but which didn't require dragging around half an OS worth of runtime infrastructure. Something more like Go or D, I imagine, if they ever get any traction as client ("desktop") languages.

Just to be a bit pedantic, you can also get native compilers for Java and C#.

The dynamic library runtimes for other languages can also be relatively big. Just my PC has around 10 versions of the C++ runtime.

Maybe you are more looking into distribution of statically compiled code?

Well, if you really want to have a native looking experience (even though it seems like apps look more and more different from one another, and increasingly less consistent), you can do that in Java, too, and with probably less work, and for free with world-class tools. I run NetBeans on my mac and it looks and behaves quite natively. Far from mediocre, I'd say.