Hacker News new | ask | show | jobs
by yole 3118 days ago
You can do isomorphic (server-side and client-side) rendering in Kotlin. For mobile UI, you can build native UIs in Kotlin for Android and for iOS, but the UI code will be different for each platform, built on the native API of the corresponding platform. At this time we have no plans to build a solution for reusing UI code between mobile platforms.
1 comments

If I can't reuse code between iOS & Android then what is the benefit of using Kotlin over just building mobile apps in Java & Swift?
IMO, It's just a different approach to the idea than the React world. I would assume the idea here is that you always want to write your UI layer "natively" in order to take full advantage of platform-specific performance accelerations/hardware APIs, but the entire stack underneath what's actually rendering visual components would be shared.

It forces you to start out more modular between your UI code and domain logic code, whereas React (& React Native) leaves the door open right at the start for tight coupling between UI code & domain logic, unless you expressly build this separation into your initial architecture.

They said UI code. You shouldn't be reusing that anyway. You should be writing stuff to take advantage of the native platform.
You can't reuse UI code between iOS and Android. You do have the ability to reuse the business logic code (domain models and so on).
Great idea , but for many react apps (both native and JS) domain models doesn’t exists. Redux + graphql apps let me eliminate even more logic. So what we actually share between react native and react JS apps are : graphql queries, reducers, saga middleware. The rest is just UI. In my usecases there is nothing to share using Kotlin.