4 ms·
> Web frameworks (and modern desktop frameworks are starting to do so) use a functional approach, the view is a pure function of the state of the application, w
by super256 4y ago
> Web frameworks (and modern desktop frameworks are starting to do so) use a functional approach, the view is a pure function of the state of the application, when you need to change something you change the application state and the view updates automatically. This solves a lot of problems that you otherwise have.
Exactly! The React pattern is incredibly intuitive, to the point where even google implemented something similar with JetPack Compose for native android apps. The only thing I dislike about Compose is the actual state management and a few quirks, but in general, I'd love to see more native UI solutions to adopt this.
- wruza 4y agoIf you’re using Qt or Gtk with a dynamic language (e.g. pygtk/pyqt incarnations), then implementing hyperscript would be a relatively trivial task. def view(): return h("GtkButton", title = "Hello”, clicked = … ) Then you get this hierarchy, compare to the old one, insert/remove/update controls and that’s it. Even issues like jumping focus on non-keyed elements will be the same. Frameworks like React don’t do as much as you think they do wrt the paradigm itself. Most of work goes into pleasing performance quirks of both js and dom.