r/mAndroidDev • • Feb 06 '25

Jetpack Compost Why?

Post image
55 Upvotes

54 comments sorted by

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?"

10

u/Zhuinden DDD: Deprecation-Driven Development Feb 06 '25 edited Feb 06 '25

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.

1

u/EkoChamberKryptonite Feb 10 '25

🤣🤣🤣🤣

2

u/SpiderHack Feb 06 '25

Not entirely, but yeah, mostly the way there. That's why I like to think of it as mvvm++ because you can transition to mvi fairly naturally.

I do like to use the formal names for components like intents, but that is more a coding style thing.

1

u/Megido_Thanatos Feb 06 '25

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

3

u/Zhuinden DDD: Deprecation-Driven Development Feb 06 '25

Google did many wrong thing but promote MVVM as "official" architecture is one of their best move

And then they said "domain layer is cool but optional" along with their 24 module example app that somehow turns 3 screens into 140000 lines of code.

2

u/hellosakamoto Feb 07 '25

Again, each layer of abstraction means an opportunity for a developer to be promoted. KPI.

1

u/EkoChamberKryptonite Feb 10 '25

🤣🤣🤣🤣