News for hackers. Stuff that matters.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by bromuro on Sunday February 15, 2026 @04:58PM (#47028053)
React is great for MVVM indeed. Who is still using MVC in 2026?
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by flowerlad on Sunday February 15, 2026 @05:12PM (#47028191)
MVVM was invented by Microsoft for 2-way syncing in WPF. Today we know 2-way syncing is a mistake.

Who uses MVC in 2026? Pretty much every framework out there, including Java frameworks and Python frameworks and .net

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by ozim on Sunday February 15, 2026 @06:19PM (#47028796)
You have any more sources on MVVM being a mistake?

I found WPF rather nice to work with. Same with knockout.js and Angular I don’t see much downsides.

Everyone can write bad code of course in each of them but I think it was working quite well.

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by lateforwork on Sunday February 15, 2026 @07:22PM (#47029312)
When React launched in 2013, its defining idea was strict one-way data flow: parents pass data down via props, and updates happen in a clear, explicit place. Children can't mutate parent state directly; they signal changes through callbacks. The result is predictable, traceable state changes.

This contrasted with MVVM frameworks like early AngularJS, Knockout, and WPF, which relied on two-way data binding. That automatic syncing felt convenient for small apps, but at scale it often led to hidden coupling and hard-to-trace update chains.

Over time, many developers came to view pervasive two-way binding as a design mistake in complex systems. React's unidirectional model gained traction because it favored clarity and control over "magic."

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by ozim on Monday February 16, 2026 @01:47AM (#47031672)
Thanks GPT but I know all of that. I was expecting some eye opening new evidence because person I was asking seemed really confident and using strong words.

But that’s just generic „blablabla”. MVVM is not a mistake and is still plenty useful.

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by lateforwork on Monday February 16, 2026 @12:25PM (#47037668)
If it is useful for you then it is not a mistake. For you.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by aloisdg on Sunday February 15, 2026 @07:03PM (#47029173)
Isn't Vue also MVVM?
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by ozim on Monday February 16, 2026 @01:58AM (#47031744)
Yes VUE is quite a descendant of knockout.js.

People confidently write strong opinions on the internet.

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by recursive on Sunday February 15, 2026 @11:39PM (#47030955)
I've heard many people assert that 2 way binding is a mistake, but I didn't think it was settled. It still seems simpler to me than so called uni-directional data flow.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by interlocutor on Sunday February 15, 2026 @05:25PM (#47028323)
Ever heard of Django? ASP.NET? Most UI frameworks, including ASP.NET Core, Spring Boot (Java based framework), Ruby on Rails, and Django (Python) are all based on MVC.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by Kerrick on Sunday February 15, 2026 @06:36PM (#47028950)
Those are all stateless MVC over HTTP, which is a very different architecture from stateful MVC for long-lived UI. The latter was invented for Smalltalk by Trygve Reenskaug, and is far more relevant to front-end web.

Stateful MVC uses Publisher/Subscriber (or Observer) to keep Views and Controllers up-to-date with changing Models over time, which is irrelevant for stateless MVC over HTTP. Plus, in stateful MVC the View and Controller are often "pluggable," where a given Controller+Model may use a different View for displaying the same data differently (e.g. table vs. pie chart), or a given View+Model may use a different Controller for handling events differently (e.g. mouse+keyboard vs. game controller). Whereas, in stateless MVC over HTTP, the controller is the "owner" of the process, and won't generally be replaced.

And in the world of front-end web, stateful MVC really is mostly dead. MVVM and Component-based architectures (using the Composite pattern) have replaced it. A runtime is usually responsible for wiring up events, rather than individual controllers. Controllers don't need to be swappable because events can be given semantic meaning in components, and Views don't need to be swappable because you can instead render a sub-composite to change how the data is shown.

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by lateforwork on Sunday February 15, 2026 @07:13PM (#47029250)
Whether application state is short-lived (e.g., request/response CRUD) or long-lived (e.g., an in-memory interactive UI) is orthogonal to MVC. MVC is a structural separation of responsibilities between model, view, and control logic. The duration of state affects implementation strategy, not the applicability of the pattern itself.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by Chris_Newton on Sunday February 15, 2026 @07:42PM (#47029450)
MVC is a structural separation of responsibilities between model, view, and control logic.

Yes, but the “MVC” pattern used by various back-end web frameworks that borrowed the term a while back actually has very little to do with the original MVC of the Reenskaug era.

The original concept of MVC is based on a triangle of three modules with quite specific responsibilities and relationships. The closest equivalent on the back-end of a web application might be having a data model persisted via a database or similar, and then a web server providing a set of HTTP GET endpoints allowing queries of that model state (perhaps including some sort of WebSocket or Server-Sent Event provision to observe any changes) and a separate set of HTTP POST/PUT/PATCH endpoints allowing updates of the model state. Then on the back end, your “view” code handles any query requests, including monitoring the model state for changes and notifying any observers via WS/SSE, while your “controller” code handles any mutation requests. And then on the front end, you render your page content based on the back-end view endpoints, subscribe for notifications of changes that cause you to update your rendering, and any user interactions get sent to the back-end controller endpoints.

In practice, I don’t recall ever seeing an “MVC” back-end framework used anything like that. Instead, they typically have a “controller” in front of the “model” and have it manage all incoming HTTP requests, with “view” referring to the front-end code. This is fundamentally a tiered, linear relationship and it allocates responsibilities quite differently to the original, triangular MVC.

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by gf000 on Monday February 16, 2026 @04:52AM (#47033047)
Is the Controller not in a coupled pair with a View? We could imagine an interface where it could be completely separate (e.g. a kiosk TUI where stuff like "press 'r' for X" is displayed), but in the vast majority of UIs the View has state, and the Controller has to depend on that state (e.g. did this keypress happen with a text field focused). Sure, this is abstracted away via the UI framework and we operate on usually some form of event system.

But even then, I don't really see how we could have a non-coupled controller-view. In fact, I seem to remember that it was described in a similar way for Smalltalk even.

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by black3r on Monday February 16, 2026 @06:45AM (#47033881)
You can have decoupled Controllers from Views using React. That's the basis of the "original" Flux/Redux architecture used by React developers 10+ years ago when React was just beginning to get traction.

A flux/redux "Store" acts as a Model -> contains all the global state and exactly decides what gets rendered. A flux/redux "Dispatcher" acts as a Controller. And React "Components" (views) get their props from the "Store" and send "events" to "dispatcher", which in turn modifies the "Store" and forces a redraw.

Of course they aren't "entirely decoupled" because the view still has to call the controller functions, but the same controller action can be called from multiple views, and you can still design the architecture from Model, through Controller (which properties can change under what conditions) and then design the Views (where the interactions can happen).

Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by gf000 on Monday February 16, 2026 @09:26AM (#47035378)
I was asking more in the abstract. Web UI frameworks usually sit on top of considerable abstraction (in the form of the DOM, eventing system, etc), so I'm not sure your reply exactly answers my question.
Re:Modern CSS Code Snippets: Stop writing CSS like it's 2015 by techpression on Sunday February 15, 2026 @05:42PM (#47028495)
Adding to sibling comments, Phoenix. And it’s a damn nice experience at that.