Skip to content
Source

Effects and Compose

On air the regular rubric "someone fought on the internet". Today on the agenda is this exchange of tweets. It all starts with mundane hating on Compose, and then one of the Compose developers comes in and it's off to the races.

Key points:

And these are pretty funny insights. It's clear where this desire comes from for Composable functions to be (conditionally) pure, but in life in my opinion it doesn't really work, given the mountains of our legacy behind the Compose world.

Too bad the alternatives aren't really revealed. I dug into our code base and tried to formulate our use cases for effects.

In general, a typical fight between those who write a tool and assume how it should be used, and those who try to apply it in practice and fight with the whole world just to get it running at all, and don't care how ideologically pure it is. You can understand both sides, but both aren't very right. We understand that all this is better not to use if you can do without. We'd also like to write such Composable functions that simply accept already prepared state. But it's impossible, either from the point of view of existing libraries (from other Google departments), or from the point of view of legacy, or from the point of view of performance, or simply the alternative is so boilerplate that it's easier for the whole community this way.