Write once, run anywhere? You must be kidding
Dropbox running on a smartphone
Dropbox has abandoned a long technical strategy of sharing C ++ code between its iOS and Android applications, saying that the overhead of Writing code twice is less than the cost of making code sharing work.
The online storage team formed the previous strategy in 2013 to allow a small team to send code quickly. Now he has "completely withdrawn from this" in favor of the use of native languages for each platform, "mainly Swift and Kotlin."
Software engineer Eyal Guthmann gave several reasons for the decision. He said that the open source culture in the C ++ developer community is weak, especially when it comes to mobile devices, so they had to build frameworks to address cross-language type declarations and interface links (for connect with Objective-C and Java), JSON analysis and serialization. This would not have been necessary using the native libraries. The team also had to create a custom construction system.
Second, Guthmann said that tools for cross-platform development are weaker than for native languages, which means that mistakes were harder to find. A problem related to the multithreaded code between C ++ and Java took "weeks to complete."
Third, due to the differences between iOS and Android, not all code can be cross-platform. You have to write specific platform code for certain things: interaction with the camera reel, for example.
Fourth, it was difficult to find senior developers to work on mobile C ++.
. The problems that Dropbox faces will not apply to all projects. Dropbox needs to integrate deeply with the operating system and performance is critical. It is possible that a customized commercial application, for example, is a better use case for a multiplatform solution, since it does not have to be integrated to the same extent. Cross-platform C ++ might also make sense for applications that make intensive use of non-visual algorithms.
That said, Guthmann's publication shows that the dream of writing once, running anywhere is, in practical terms, still far away for many types of application. ®
Balancing consumerization and corporate control