|
|
|
|
|
by felipefar
748 days ago
|
|
I'm already convinced of the benefit of declarative GUIs over imperative ones. To be clearer, what I mean by declarative GUIs is ones where I can specify that UI elements should be bound to certain values in the memory of my program, so that they don't have to be changed explicitly by imperative code. Ex.: TextBox {
Text: app.currentUser.name
} Instead of having to call setText on that TextBox. What I'm still missing is why it has to involve a virtual tree being maintained and synchronized with the real GUI tree. The UI engine could implement the above binding by instantiating for the user a callback trigerred when the bound property changes and changing precisely the value currently shown on the screen. Hence, the UI engine is in charge of the callbacks, which keeps the user unburdened by callbacks. |
|
(Or at least, to paraphrase Joseph Heller, “it’s intuitive once you get your head around it”)