@prasanna Since the XML system requires imperative implementations, it’s fairly easy to miss a piece of state when updating your UI, and one of the best ways to avoid inconsistent updates is to use a pattern where you maintain one (or more) object(s) that represents the UIs current state (historically called a View Model before Android appropriated the term as a system component). Updates in the domain layer could only make their way to the UI through UI state objects, which in theory required the entire UI to be consistent across all updates. (In practice you could implement it poorly and start treating the state object like the UI itself, creating inconsistent updates which then still allow bugs in UI even though technically the UI is consistent with the state object…)
In XML, if we’re all using this ViewModel/UIState pattern, that means every single developer/team is putting in work to re-implement essentially the same binding logic imperatively. Compose does away with that distributed redundancy by providing us with a declarative framework that only cares about the end-state. The compose compiler/engine figures out how to move from one state to another, so we’re not all rewriting that same logic anymore. Instead we just need to worry about the models that are specific to our application, reducing complexity AND effort. Of course it isn’t without it’s own overhead, and most people have trouble when they get started with animations or transitions, but even that is easier to learn and apply than it was in the old XML system. And optimization is a whole other level, but even without careful optimization, Compose is highly performant. The Android Code Labs are excellent to start with if you have trouble getting through documentation. It’s too easy.
Get started NOW:
https://developer.android.com/codelabs/jetpack-compose-basics#0