HACKER Q&A
📣 clumsysmurf

Are declarative UI frameworks the way forward in all 2D UIs?


Lately I have been learning Jetpack Compose (for Android). Its new and shiny, like its counterpart SwiftUI (Apple), but there are older frameworks that take this approach, like React.

The main problem being solved, according to the marketing materials, is that its easier to keep state in sync with UI by regenerating the UI as state changes. Lots of work goes into avoiding updating the tree of UI that hasn't changed. This sounds good.

Is the declarative approach the way forward for all 2d UIs (even outside mobile)? Is there still merit with the older approach of stateful widget trees and mutating their state imperatively? Where will we see the traditional (imperative) way maintain its niche compared to declarative UIs?


  👤 sargstuff Accepted Answer ✓
> ... traditional (imperative) way maintain its niche compared to declarative UIs ...

Where tied to traditional inputs/usage vs. gpt interpretation/generation from non-traditional / aggregate ai interpretation of input sources (eye glances, audio descriptions, "location context", etc. )