Newbie multiplatform user here: with iOS now being...
# multiplatform
j
Newbie multiplatform user here: with iOS now being able to use Compose Multiplatform, it seems like a lot of frontend can be shared along with the backend now in a mobile KMM project. Is it a bad thing to have most of my code now being in
shared
?
c
Why would it be a bad thing?
j
Isn't one of the main perks of KMM being able to use platform-specific stuff where it's more efficient? Feels wrong that everything is just multiplatform
c
Sure, when it's more efficient. But all your common code is already calling functions that are expect/actual to the platform native APIs, so you already get the benefits
d
lol... full
shared
is my Zen state, App projects be like:
fun main() = org.name.shared._main_()
Embrace ❤️ K
(This is far from meaning that all the code is in
common
, plenty of
expect
/
actual
going on in
shared
module).
p
Even in shared folder you can still do expect/actual and/or inject platform specific implementations. Even better than putting everything in shared, I would say put it in a multiplatform Library.
d
That's what
shared
is?
p
Right, shared is basically a library
c
If your project is large, I recommend splitting `shared`into multiple modules
p
Yeup, into multiple "shared" ones