Live data from Hacker News

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

blogs.dropbox.com

41–50 of 335 posts

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

#41
post #28

another code-sharing solution that everyone enjoy to ignore is Adobe AIR in 2013, AIR was v3.6, now in 2019, AIR is v33.0 not only you share code via ActionScript 3 (something like TypeScript just available 10+ years ago) but you can also develop ActionScript Native Extension (ANE) in C, C++, Objective-C, Java, C#, Swift, etc. and it does not only publish to mobile it also publish to desktop but that's OK, keep ignor…

You are right. I've done a lot of development in AIR myself and it is super impressive. Easy TypeScript like language. The Flex SDK is mature with all the standard stylable controls you need. Dedicated IDE that just works great. Easy deployment. I was able to build a cross platform (iOS/Android/Web/Desktop) video chat application with it and it looked and worked great everywhere. Someone dropped the ball somewhere with AIR.. I'm amazed they're still updating it.. that's something at least.

I guess it lives on here? https://github.com/apache/royale-asjs Still looks active..

Here's a demo https://royale.apache.org/tourdejewel

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

#42
post #9

The overhead of C++ adoption actually prevented us from ever moving fully in this direction. Today, unlike in 2013 when they started, there are other options. For others considering code-sharing, another option not mentioned in their article is Rust for the core with Swift and Kotlin. Between bindgen, futures, serde_json and non-nullable pointers in Rust, those would satisfy their stated subcategories today. Companio…

Its pretty evident from things they said in this blog post that they want to stay firmly in mainstream. They mentioned C/C++ is the only compiler supported by both platform vendors, which is important due to a "whole host of other issues" that they didn't specify. So using a compiler developed by a company that doesn't even sell commercial support would be a non-starter. Still there are commercially supported platforms that are quite mature at this point, such as Xamarin.

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

#43
post #40

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…

Which framework are you using for this?

React Native

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

#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 weeks going down a rabbit-hole to get Flutter talking to a .NET assembly by embedding Mono and invoking via JNI/Obj C, so I know the pain of native interop. If you're mostly doing work at the native platform level, then I can imagine why you'd stay away from a cross-platform VM.

In my case, I ended up with a brittle project that was clearly going to be a PITA to maintain & automate builds for, so I just rewrote the component in question in Dart.

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

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

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

#48
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…

AirBnB has a series of in depth blog posts about their decision to abandon RN. In particular this quote seemed extremely worrying to me:

> While debugging, React Native attaches to a Chrome Developer Tools instance. This is great because it is a powerful debugger. However, once the debugger is attached, all JavaScript runs within Chrome’s V8 engine. This is fine 99.9% of the time. However, in one instance, we got bit when toLocaleString worked on iOS but only worked on Android while debugging. It turns out that the Android JSC doesn’t include it and it was silently failing unless you were debugging in which case it was using V8 which does. Without knowing technical details like this, it can lead to days of painful debugging for product engineers.

https://medium.com/airbnb-engineering/react-native-at-airbnb...

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

#49
post #39
post #35

Earlier quoted context omitted.

I wasn't suggesting electron. Just a responsive website when that's sufficient.

Most websites are resource hogs.

So, 3 codebases or be careful about your website...for cases where a native app isn't truly needed.

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

#50

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.

> it became increasingly difficult to hire replacement senior engineers with relevant C++ experience who would be interested in mobile development.

It's not just familiarity with the language, it's being willing and able to develop within the mobile development context, which as stated in the article is a whole other beast

Post reply on HN