August 7, 2023

Android - Jetpack Compose and state

I always find it amusing that we have a language (like Haskell or even C#) that makes things immutable and then forces you to jump through hoops to have "state" (i.e. variables).

I am being a bit unfair dragging Kotlin and Jetpack into this, but you find yourself dealing with unexpected complication when you want to have some state (such as clicking a button and setting some kind of flag). In the case of Jetpack, it is about making the infrastructure aware that you changed something and that it might need to redraw things on the screen. It ends up smelling a bit like Monads in Haskell -- just keep that thought on the back burner.

This 7 part series talks about all of this and looks pretty good:


Have any comments? Questions? Drop me a line!

Adventures in Computing / tom@mmto.org