Live data from Hacker News

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

blogs.dropbox.com

131–140 of 335 posts

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

#131
It seems like the real issue was that Dropbox lost all of their senior C++ engineers. That’s a real mistake on their part, losing the only people who truly understand your product can be a death sentence for a company. I know my employer is very conscious of who knows what part of our products, and does their best to ensure that we never have any knowledge gaps.

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

#132
post #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 wi…

I think it was sullied by the poor reputation of the Flash Player browser plugin.

I agree that ActionScript was a pretty decent language to work in.

I investigated Haxe briefly but found the community wasn't very big and the community that did exist was really fragmented.

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

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

How does Rust differ significantly from C++, other than the fact that neither platform's toolchain can compile it out of the box?

It is really easy to make a blunder in c++ that will require a lot of effort to find. Debugging that on mobile platforms is not fun. Like they mention a deadlocking issue that was difficult to solve.

Rust is built for memory and thread safety. Also the much better build system and open source ecosystem.

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

#134
post #6
post #2

Hard to take any of the arguments seriously when looking at the Electron app they just released on desktop.

I initially had a similar thought, but I don't think that applies here. With Electron, you don't write a cross-platform base and then write all the platform-specific goo on top of it. You just write your app using web technologies, press the build button, and ship it on all the platforms you want to support. Since web technologies are popular, you don't end up with the same issues hiring and training developers like…

And while a lot of developer-y types complain, a bit of extra resource usage on a laptop/desktop isn't nearly as big of deal as it is on mobile.

Especially if your business (like so many nowadays) has way more users on mobile than it does on the desktop.

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

#135
post #52

1.5 years ago Dropbox was looking into rewriting their shared mobile codebase in Rust. It's a shame this blog post doesn't touch upon that at all, instead focusing on C++.

Their hinted opinion on that:

> That being said, C/C++ are the only languages with a compiler supported by both Google and Apple, so using a different language would have created a whole host of other problems to deal with.

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

#136
post #135
post #52

1.5 years ago Dropbox was looking into rewriting their shared mobile codebase in Rust. It's a shame this blog post doesn't touch upon that at all, instead focusing on C++.

Their hinted opinion on that: > That being said, C/C++ are the only languages with a compiler supported by both Google and Apple, so using a different language would have created a whole host of other problems to deal with.

Is that still true? If Rust is built on clang it should not be that hard to port. Go also runs on both AFAIK.

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

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

> a good requirements spec I think that kills a lot of interesting projects right there. If I could write a solid spec, that would mean I believe I wouldn't learn much from shipping the product. And also that my competitors aren't learning or advancing.

Whatever you first create has some kind of vision behind it. Even if that vision is a rough spec, it might be precisely the little bit of spec that’s necessary to get things started.

A good requirements spec doesn’t mean it has to be heavyweight with all the corners and edges figured out. Instead, it can be just lightweight enough to get things moving in the proper direction... but some little direction is certainly needed.

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

#138
post #93
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…

This is a fascinating idea, and reminds me of the dreaded [1] rewrite , where you rewrite the application because the new system will always be better in the new framework ... But this is different, if you write things simply , so the code can be ported easily . Then you're essentially making the code easier to share, without tightly coupling it to a specific platform... seems like a big win to me [1] http://wiki.c2.…

Agreed that it is both fascinating, and from the experience I’ve had with the approach, it has turned out to be quite an effective way to build very maintainable software.

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

#139

Earlier quoted context omitted.

I think it's a bit of an unfair characterization. I don't use emac or CLI as my client, I enjoy a beautiful UI as much as the next guy but electron is a real bother to me. I switched from Sublime to VS Code and went from 20MB of RAM usage to 500. Add slack, add discord, you now have GBs of RAM getting eaten up just for the UIs. Most mid-range laptops still only have 8GB of RAM, add a browser to the mix and it's a con…

Huh. My laptop has 8 gigs of RAM, and I run many programs simultaneously (usually including several codebase analysis servers behind Emacs, a VirtualBox VM or two, Slack, and of course tens of Chrome tabs, several in development mode), but I don't have anything like the problems you describe. I do use The Great Suspender aggressively in Chrome and that does help a lot. My Emacs instance itself is extremely tricked ou…

I'm impressed you can run all that especially multiple VMs on 8gb, I have to close Firefox when I need VMs. I'm on windows 7, on a Dell Inspiron with a RAM and disk upgrade, no special configuration or software. I didn't think to look for an addon to do that, that's pretty cool, I downloaded the Firefox equivalent, might do the trick!

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

#140

Add more fuel to the "write once, run anywhere" dumpster fire. Let's peek in there - I see C, C++, Java, JavaScript, stored procedures, wxWidgets, RubyMotion, GTK, QT, object oriented programming, functional programming, PhoneGap, React Native, Flutter, ... It is getting full in there. What's that about the definition of insanity? Doing the same thing over and over and expecting a different result? Sever side rendere…

I'm using Flutter successfully. It has the potential to become a really great platform.

Java is a good language, as long as you rarely use implementation inheritance.

I would not recommend using React Native or C++ for any project.

Post reply on HN