It has been gaining quite some steam, everyone's talking about it on developer forums, but: is Kotlin Multiplatform production ready yet?
And what makes this approach to cross-platform development so interesting?
Why not go with Flutter or Swift or...
Now, let me shed some light on your questions:
- What is Kotlin Multiplatform?
- Why use it? What makes this approach to cross-platform development so different?
- Is Kotlin Multiplatform production ready?
1. What Is Kotlin Multiplatform?
It's a code sharing mechanism (rather than just another cross-platform framework) that enables you to share key business logic written in Kotlin across multiple platforms. At the same time.
In other words, you can define and store business logic, repositories, data objects, etc. into one common and reusable library module, which will then be consumed within your native applications.
Your native platforms – say, iOS and Android – will consume this module like any other third-party library.
2. Why Use It? What Makes this Approach to Cross-Platform Development So Different?
Before I answer your "Is Kotlin Multiplatform production ready?" question, let's see why you'd want to choose it over... any other cross-platform solution.
Why would you want to set up a Kotlin mobile multi-platform project?
For one strong reason:
You're free to decide just how much code you want to share. Apart from that, you can stay true to the native platform you're building your mobile app on.
It's up to you how much code your Kotlin Multiplatform projects will share.
And since your KMP projects won't be building entire cross-platform apps from the ground up, you're not forced to take any risky big decisions:
If it turns out that the module storing common code doesn't meet your needs, you can easily... replace it.
This gives you a lot of flexibility.
In short: the Kotlin Multiplatform approach enables you to share common code via a high-level language, with no need to wrap entire API surface or UIs of the target native platforms.
3. Is Kotlin Multiplatform Production Ready?
There already are Kotlin Multiplatform projects that you might want to check:
... but (for there is one), my recommendation to you is to use Kotlin Multiplatform in production on a small project. For now.
If you're dealing with a larger project, you might find it less manageable. Its ecosystem still has that "smell of fresh paint" to put it this way and poses a few challenges:
- multi-threaded coroutines
- debugging native code
- third-party library support
Considering the unmatched flexibility that it grants developers with, would you consider the Kotlin Multiplatform approach for your future cross-platform app?
Given that there already are KMP projects running in production.
Or do you still hesitate and prefer to wait until it's 100% "wrinkle-free"? Ready to power larger projects as well...Image by Csaba Nagy from Pixabay