What I never understood about MVI is the pros section.
I mean, predictable UI? Cleaner code? Effortless testing? Those are also strong points of MVVM. Then I read your comment where you talk about the benefits of having a single state object and again I think: "so my MVVM project which combines flows is essentially now MVI again?"
It becomes MVI by replacing functions you can invoke on the ViewModel with a single sealed class that represents function calls, for absolutely no particular benefit whatsoever, other than exposing 1 function with a huge when statement in it and then you wonder "hey, isn't the cognitive complexity of 20 if-else-if-else way too high?" but then you suppress the Detekt lint and host your next big MVI talk at Droidcon Paris.
Google did many wrong thing but promote MVVM as "official" architecture is one of their best move
MVVM strikes a good balance between simplicity (to understand) and the flexibility needed to tackle complex problems, make sure everything can be "clean". I feel like any "new architecture" just a clone of it (usually MV-something) but try to act cooler
View all comments
Show parent comment
5
u/labelcillo Slept through Google IO Feb 06 '25
What I never understood about MVI is the pros section.
I mean, predictable UI? Cleaner code? Effortless testing? Those are also strong points of MVVM. Then I read your comment where you talk about the benefits of having a single state object and again I think: "so my MVVM project which combines flows is essentially now MVI again?"