Live data from Hacker News

The not so hidden cost of sharing code between iOS and Android

blogs.dropbox.com

51–60 of 335 posts

Re: The not so hidden cost of sharing code between iOS and Android

#51
post #44

I shudder to think how many people will read this headline and immediately takeaway that React Native/Flutter/Electron are terrible cross platform solutions.

I'm hoping more people will read this headline and at least take away that RN/Flutter/Electron should be approached with caution and care rather than "slap it in an Electron shell and it'll run great everywhere and everyone will love it," which is the implicit attitude that makes so many people, uh, not love it.

Re: The not so hidden cost of sharing code between iOS and Android

#53

I've been considering building a pwa and using a webview as a pseudo native app I know iOS support isn't great but it seems to be improving and iOS push notifications could be built separately in the meantime. How's anyone tried this approach?

While PWA’s largely work, they provide a poor installation experience and little device integration. Most people use Apache Cordova, PhoneGap, or Ionic as wrappers to their mobile web app, providing expected installation experiences through app stores and common device integrations.

Re: The not so hidden cost of sharing code between iOS and Android

#54
post #46

I'm somewhat disappointed that this didn't work out, as I have usually promoted a C++ core along with a thin native wrapper as the solution for those looking to share code across platforms. At least they moved to native development, though, instead of some poor facsimile that was "easier"…

Curious about how well having that C++ core to share code has worked out for you in the past. Apart from low-level contained code that doesn't require access to too many OS interfaces (user I/O, network, threading, GPS etc) I can't imagine it would be easy or useful to have a C++ core.

Usually C++ runs core logic that cannot go on the server (that's things like your own custom client-side crypto, parsing, or other "pure computation") and then you make the user interface in Swift or Java depending on your platform.

Re: The not so hidden cost of sharing code between iOS and Android

#55
post #15

I have come to this same conclusion after many years. It's not cost-effective to have any bespoke business logic (models, controllers, etc.) shared between the two mobile platforms (don't get me started on sharing UI code). If you have some incredibly tricky low-level algorithm/library and/or need for speed, think database, crypto, intense graphics, etc., then fine, you may be able to swing a shared module in C++ or…

How does that work out when things change over time: requirements and the platforms themselves?

Re: The not so hidden cost of sharing code between iOS and Android

#56
post #46

Earlier quoted context omitted.

Curious about how well having that C++ core to share code has worked out for you in the past. Apart from low-level contained code that doesn't require access to too many OS interfaces (user I/O, network, threading, GPS etc) I can't imagine it would be easy or useful to have a C++ core.

Usually C++ runs core logic that cannot go on the server (that's things like your own custom client-side crypto, parsing, or other "pure computation") and then you make the user interface in Swift or Java depending on your platform.

That makes sense - basically anything that is self-contained and can run "in a vacuum" so to speak can be C/C++.

Re: The not so hidden cost of sharing code between iOS and Android

#57

It's funny that they have a hard time hiring experienced senior C++ devs even though the language has been around so long. Presumably it would have been easier to find someone really good at something newer like, say, Vue.

I wonder if that is a symptom of C++ having many recent revisions, thereby influencing, misleadingly, the definition of "experienced".

Yeah, I have 15 years of C++ experience, but not since 2012. So with C++11 and C++17 (and soon C++20) my skills have not aged well, even though I can still write C++03 just fine. It's no wonder 'senior' devs prefer to use plain C, where even C11 is not that different from C99.

Re: The not so hidden cost of sharing code between iOS and Android

#59
post #45

TLDR - it's too hard to find senior C++ mobile devs. I'm more intrigued by AirBNB moving away from React Native - the linked article says "RN was too small a component to bother supporting, and the developer experience wasn't up to par", but I'd like more detail than that. I've been working with Flutter for the past 6 months, and it would definitely be my "go-to" for any mobile application. To be fair, I did spend 2…

Is flutter actually a good choice for a production app right now? I've heard really bad things about its bugs, but I admit it does look great to use and develop with.

Re: The not so hidden cost of sharing code between iOS and Android

#60
post #34

It baffles me that people think duplicating application code for every device is the way to go. Cross platform can be done correctly. I'm working on a stack that can natively target Windows, Mac, Linux, Android, iOS, MacOS, and Web. I couldn't imagine duplicating my code for each one of these devices. If something special needs to be done, I write an extension. I have a feeling posts like these get upvoted because de…

I took this as an argument for a thin, or at least thinner, client. If something is complicated and costly to maintain - shouldn't it move to the server? What complicated processes are you doing on-device that couldn't be done somewhere else & fronted by an API?

Anything you want to run locally without being tethered to always-on connectivity, for one. Or just anything you want to run without network latency.
Post reply on HN