Sometimes, using immutable state makes something simple hellishly complex
For example, you need to change a property on an item inside a list inside another item in a list
That’s one line with mutable state. That’s one crazy mind bending expression with immutable state
For example, you need to change a property on an item inside a list inside another item in a list
That’s one line with mutable state. That’s one crazy mind bending expression with immutable state
Comments
Nothing is worse than exposing a mutable object where any thread can uncontrollably modify things without notifications. That makes code unpredictable.
People will latch on to one or two approaches, and then doggedly defend them until the grave.
Immutability is one of those things in the Flutter world
The MVU approach came from an FP background where it made more sense. React, Flutter and Jetpack compose have all followed suit, but none of the languages are pure FP…
How many widget fields in the core framework have MUTABLE lists? Does Dart even have an immutable list? No.
Only Haskell really gets this right anyway, but that’s another story…
Don’t listen to anyone, including the Flutter team without road testing what they’re saying.
If it feels like an uphill battle, it’s probably because it is.
https://www.christianfindlay.com/blog/immutability-dart-vs-fsharp