The Not-So-Hidden Cost of Sharing Code Between iOS and Android
Article Summary
Eyal Guthmann from Dropbox shares a hard truth: writing code once in C++ cost them more than writing it twice in native languages. Here's why their cross-platform strategy backfired.
Back in 2013, Dropbox adopted C++ to share code between iOS and Android with a small mobile team. By 2019, they completely abandoned the strategy in favor of Swift and Kotlin. The overhead of maintaining a custom stack outweighed the benefits of writing code once.
Key Takeaways
- Custom frameworks like Djinni were needed just to interact with native platforms
- Debugging multi-threaded C++ bugs took weeks versus days in native code
- Platform differences meant code still required extensive platform-specific work
- Couldn't hire senior C++ mobile engineers after original team left
- Mobile developers left the project rather than work on custom C++ stack
The overhead of custom tooling, hiring challenges, and platform differences made writing code twice in native languages cheaper than writing it once in C++.
About This Article
Dropbox's C++ strategy meant building custom frameworks and libraries like json11 and nn. These tools duplicated work that native languages and open source projects had already solved, creating unnecessary maintenance overhead.
The team switched to Swift and Kotlin instead. This let them use each platform's native tooling, standard libraries, and existing open source ecosystems rather than maintaining their own solutions.
Developers got better debugging tools and proper mobile IDEs. Multi-threaded issues that once took weeks to debug became manageable, and engineers could keep their skills aligned with what the industry actually uses instead of being stuck with custom stacks.