

In Compose, state is explicit and passed to the composable.

Compose really provided a solid answer for us in this.” (Twitter) That makes them easy to reuse and test: “ We set a goal for ourselves to deliver a new set of UI components that were stateless, easy to use and maintain, and intuitive to implement/extend/customize. With Compose, you build small, stateless components that are not tied to a specific activity or fragment. We've been able to accomplish within a single Kotlin file what otherwise extended across multiple XML files that were responsible for attribute definitions and assignments via multiple layered theme overlays.” (Twitter) The APIs are intuitive - easy to discover and use: “ Our theming layer is vastly more intuitive and legible. Reading the code for complicated components is easier as well.” (Square)Ĭompose uses a declarative API, which means that all you need to do is describe your UI - Compose takes care of the rest. “ The layout system of Compose is conceptually simpler so it’s easier to reason about. The code you’re writing is written only in Kotlin, rather than having it split between Kotlin and XML: “ It’s much easier to trace through code when it’s all written in the same language and often the same file, rather than jumping back and forth between Kotlin and XML” (Monzo)Ĭode written with Compose is simple and easy to maintain whatever you’re building. We’re writing fewer lines of code per-feature, which allows us to focus more onĭelivering value to our customers.” (Cuvva) “ We were very pleased to see how few lines were required to create lists or animations in.“ There’s also a significant reduction for any screen built with a RecyclerView, which the.“ For the same Button class it was 10x of magnitude smaller.” (Twitter).Writing less code affects all stages of development: as an author, you get to focus on the problem at hand, with less to test and debug and with less chances of bugs as a reviewer or maintainer you have less code to read, understand, review and maintain.Ĭompose allows you to do more with less code, compared to using the Android View system: Buttons, lists or animation - whatever you need to build, now there’s less code to write.
