Dropbox would rather write code twice than try to make C++ work on both iOS and Android

Write once, run anywhere? You must be joking


Dropbox has abandoned a longstanding technical strategy of sharing C++ code between its applications for iOS and Android, saying the overhead of writing code twice is less than the cost of making code-sharing work.

The online storage outfit formed the previous strategy in 2013 to enable a small team to ship code quickly. It has now "completely backed off from this" in favour of using native languages for each platform, "primarily Swift and Kotlin".

Software engineer Eyal Guthmann gave several reasons for the decision. He said the open-source culture in the C++ dev community is weak, especially when it comes to mobile, so they had to build frameworks to address cross-language type declarations and interface bindings (to connect with Objective-C and Java), JSON parsing and serialisation. This would not have been necessary using the native libraries. The team also had to create a custom build system.

Second, Guthmann said the tooling for cross-platform development is weaker than for the native languages, which means bugs were harder to find. One issue involving multi-threaded code between C++ and Java took "weeks to nail down".

Third, because of differences between iOS and Android, not all code can be cross-platform. You have to write platform-specific code for certain things – interaction with the camera roll, for example.

Fourth, it was hard to find senior developers to work in C++ mobile.

Dropbox may have made cross-platform coding particularly challenging by choosing C++ rather than C# or JavaScript. On the other hand, Guthmann 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."

The particular problems faced by Dropbox will not apply to every project. Dropbox needs to integrate deeply with the operating system and performance is critical. It is possible that a custom business application, for example, will be a better use case for a cross-platform solution since it does not have to integrate to the same extent. Cross-platform C++ might also make sense for applications that make heavy use of non-visual algorithms.

That said, Guthmann's post does show that the dream of write once, run anywhere is, in practical terms, still far off for many types of application. ®

Similar topics


Other stories you might like

  • Dropbox basically decimates workforce, COO logs off: Cloud biz promises to be 'more efficient and nimble'
    CEO says he is 'truly sorry for painful but necessary' cuts

    Dropbox is close to decimating its workforce, firing 11 per cent of staff in an effort to become “a more efficient and nimble” company, its CEO announced on Wednesday.

    In a blog post, Drew Houston said the decision to sack 315 workers was “one of the toughest decisions I’ve had to make in my 14 years as CEO,” and that he was “truly sorry,” but that the decision was necessary for the company’s long-term goals. The company’s COO is also leaving.

    Given that Dropbox’s entire business revolves around allowing other companies to remotely share information and collaborate - something that should mean boon times during a global pandemic where tens of millions of employees are now working from home - the market was not impressed. Dropbox shares fell more than six per cent before recovering slightly to 5.4 per cent down at the time of writing.

    Continue reading
  • Don't forget to brush your teeth, WFH staff told as Dropbox drops the office, declares itself 'virtual first'
    But is remote working less productive?

    Cloudy storage company Dropbox has declared itself a "virtual first" company, meaning that for all of its employees "remote work (outside an office) will be the primary experience".

    The 3,000-staffer company, which has a head office in San Francisco and 12 offices elsewhere around the world, said that while remote will be "the day-to-day default for individual work", it plans to have "collaborative spaces" called Dropbox Studios in all the locations where it currently has an office.

    These will be in the current office building in some but not all cases, depending on whether it has a long-term lease. Employees will not generally be allowed to use these spaces for solo work, only for meetings or team work, though "there may be exceptions based on team or role". These new spaces will not be set up until "it's safe to do so".

    Continue reading
  • Cloudflare, Dropbox, Reddit and friends launch Section 230 compromise coalition as change seems inevitable
    De-FAAMG'd tech outfits fear being steamrolled

    The second tier of tech giants have formed a new coalition focused on making sure changes coming to platform liability don’t squash them.

    The Internet Works coalition comprises, among others, Cloudflare, Dropbox, eBay, Etsy, GoDaddy, Nextdoor, Patreon, Pinterest, Reddit, Tripadvisor, Vimeo, and the Wikimedia Foundation, and will “work with Congress to promote the benefits of Section 230, a provision of the Communications Decency Act.”

    In truth, though, the decision to stand together says two things: first, that they have accepted changes to Section 230 are inevitable after years of insisting that the clause is sacrosanct, and can’t be touched for fear blowing up the entire internet economy. Second, they are worried the top-tier tech giants – Facebook, Amazon, Apple, Microsoft, and Google, aka FAAMG – will out lobby them and get changes that work for them but weigh heavily on smaller companies.

    Continue reading

Biting the hand that feeds IT © 1998–2022