In my previous job, I had the chance to rebuild and relaunch an app 100% Compose + Kotlin Multiplatform.

Here are the top insights, for good or bad, from top of my head.

Follow the thread. 🧵

#AndroidDev #Compose #Kotlin
1. After years of XML, Compose is refreshing for the Android ecosystem. It allowed us to build beautiful UI and amazing animations. If you aren't sure about using Compose: yes, Compose is production ready.
2. Compose is not as mature as the View System. You will need to use experimental APIs, and a few times go out of your way to find a solution. That includes wrapping a View inside a Composable.
3. Which brings me to: Compose interoperability is mind-blowing. I didn't expect such a good experience, well done Compose team.
4. Compose reusability is incredible. As the project started, we focused on creating good foundation components. After a few weeks, building a feature was a matter of composing UI components! The productivity was incomparable to the previous project.
5. It was easy to onboard mid and senior engineers with no Compose experience, but it was painful to onboard junior engineers. They had a really bad time understanding the Compose mental model and ended up creating spaghetti Composables for a quite long time.
6. We did face performance problems here and there (mostly for lists or custom animations). We had to manually optimize it but it didn't take much time or effort.
7. Compose Previews are not there yet. That said, I have been working with large projects for years, and from experience: the View System preview does not work most of the time on any complex view... so it didn't impact me.
8. Navigation for Compose is better if compared to Fragments, but it has arguable decisions (lack of Parcelable, to say one) for good or for bad. For us, it was bad: we had to improvise multiple times to achieve what we needed. I'm not satisfied with what we ended up with.
9. There is no "Back Stack primitive" for Compose apps. If you want to build a Single Activity app without Fragments or Navigation, you will lose integration (how do you scope a ViewModel?). In other words, you would need to write your own LifecycleOwner/ViewModelStore/etc.
10. Compose can throw cryptic and scary error messages. That caused us problems and negatively affected our productivity. I'm not sure if we could have done something better here...?
11. DI/SL: Dagger does not work on Kotlin Multiplatform. Be prepared to do Manual DI or use a Multiplatform friendly library (ie, Koin, Kodein, etc).
12. Single Activity is by far, the best decision we took while building a new app from scratch. It removes so much complexity and I can't recommend it enough.
13. Coroutines works well on the Android side but we did face problems with Kotlin Multiplatform. I heard it gets better with the new Memory Model but I didn't have the chance to check it out.
14. In Compose everything is a function, it also means that (almost) everything is in your public namespace. That can impact auto-complete, and make it hard to discover functions if you don't plan well your Composables.
15. Nope, we didn't use Clean Architecture. Thanks.
That is it! Building a new app with Compose from scratch was such a fun experience. I didn't plan the thread to go mostly about Compose but I can't help myself.

I'm super optimistic about Android's future: UI's with Compose + ecosystem with KMP is a game changer.
Let me know if you have questions or if there is any bit you would like me to expand. I will be happy to share as much as I can.

Until then, see ya! 🚀

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Marcello Galhardo 🇪🇺🇺🇦

Marcello Galhardo 🇪🇺🇺🇦 Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Don't want to be a Premium member but still want to support us?

Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal

Or Donate anonymously using crypto!

Ethereum

0xfe58350B80634f60Fa6Dc149a72b4DFbc17D341E copy

Bitcoin

3ATGMxNzCUFzxpMCHL5sWSt4DVtS8UqXpi copy

Thank you for your support!

Follow Us on Twitter!

:(