dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.21k stars 1.75k forks source link

MVU might not be what you think it is #118

Closed aspnetde closed 4 years ago

aspnetde commented 4 years ago

When I was reading the official announcement the other day, I was surprised what was presented there as MVU:

readonly State<int> count = 0;

[Body]
View body() => new StackLayout
{
    new Label("Welcome to .NET MAUI!"),
    new Button(
        () => $"You clicked {count} times.",
        () => count.Value ++)
    )
};

As far as I am concerned, this is not MVU. I already wrote down some thoughts on why I think so here.

Don Syme, who, as I understand, spent several months of 2018 on implementing MVU on top of Xamarin.Forms and building what later became Fabulous, is a bit more diplomatic, but the bottom line is the same.

So, what's my point?

Cheers!

Lelelo1 commented 3 years ago

As i see this and what the snippet look like to me is something I first found in React, then Flutter, then in SwiftUI. I'ts fine having any name for it.

MappingSteve commented 3 years ago

I haven't used Elm, but the essence of what I'm looking for, when I think "MVU", is what one does in React (at least as I understand it - I've only done limited work in React JS):

Its a "functional programming" paradigm. Avoiding the problems that MVVM has (in my experience), in layouts with complex inter-dependencies. Any inter-dependencies are resolved by the app developer in writing the tree. The renderer has a straightforward task.

IMHO, Its easier to debug tree-writing code, than figuring out what went wrong where in the data binding. I'd rather do it that way, even if at first it takes more coding.

Is that close to what is being considered?


How can I get involved in MAUI MVU development? I've got years of (often painful) experience pushing Xamarin Forms to the limit.

-- ToolmakerSteve

shirshov commented 2 years ago

I'm trying to make Full MVU library for Xamarin.Forms

https://github.com/shirshov/laconic

ToolmakerSteve commented 2 years ago

@shirshov - Can you compare-and-contrast your approach To Fabulous?

And maybe say a little about how all these approaches compare to ReactJS + Redux or ReactJS + Formik? That's the closest tech that I am familiar with. (Formik seemed simpler for my purposes in JS than Redux, so I chose it over Redux.)

MarcCoquand commented 2 years ago

MVU to me has always been the elm architecture. Using it has led to a fantastic developer experience where I've been able to write thousands of lines of code and ship without any production bug. I must echo the other ones here, it shouldn't be called MVU unless it's actually the same as elm's MVU. It bogs down the term and I wish companies instead strived to implement the real thing since that would be a gain for the industry. Microsoft should take responsibility, their actions end up shaping the terminology we use. It would make me sad if they ruined the term.