Thomas Bandt

Microsoft's MVU Is Anything But MVU

At Build 2020, Microsoft announced a new initiative to build multi-platform user interfaces. Along with the announcement came something that has been discussed heavily on Twitter: Its interpretation of Model-View-Update.

Published on Monday, 25 May 2020

While the initiative, called MAUI for .NET Multi-platform App UI, was basically well-received within the developer community from what I could read, some people got angry about the MVU sample in the official blog post.

And it's easy to tell why. Because this is not MVU:

readonly State<int> count = 0;

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

I already wrote a few words about how MVU works from my perspective, which also got referenced in that announcement post. This is a bit ironic, as my described understanding is more or less orthogonal than what is shown there:

  1. There is no init function.
  2. There is no update function.
  3. There are no messages.
  4. Therefore there is no transparent dataflow.
  5. There are no commands.
  6. Updates are performed through functions within the view part.
  7. The state is being mutated.

From my perspective, this is somewhat mimicking SwiftUI. This is not a bad thing, as it might be a considerable step toward code-based UI development on the future .NET platform. It could also provide the foundation of a more functional programming approach that may become even "real MVU" eventually.

So I appreciate the initiative. But calling it MVU just does not make sense and should be reconsidered.

Update: Okay, there is some confusion about the strong and clickbaity title and the rather friendly conclusion I drew here. Let me put it in another way. I think whoever is responsible for that sample in the blog post – and I think it's coming from the Comet library – didn't know what they were doing when describing the whole thing as MVU. It's simply not. Now that the word is out, I fear that Microsoft is just using that name, and with all its marketing power is going to rewrite its meaning. As Alex wrote: Maybe MSMVU would fix it ;-).

What do you think? Drop me a line and let me know!