Comment by aatd86
6 hours ago
Yes, declarative UI is just an abstraction of imperative code. :) The rest is properties of the internal implementation. The VDOM way obfuscates the internals more. Doesn't let you control rendering appropriately. It is so because the diffing and reconciliation algorithm have to be able to remove any subtree of views/nodes from the UI tree.
Then you can only have islands of either paradigm within each other. UIKit and SwiftUI do indeed compose, albeit coarsely.
I can't blame them, they got influenced by react. Don't even blame react, it was a good attempt. Basically trying to build a UI from a snapshot of a tree. Except this is too simplistic a model. They designed it as if you could equate the number of games and the number of positions in chess. Like a markov chain. Except playing chess has side effects. A mere snapshot does not encode those.
I understand the mistake.
No comments yet
Contribute on Hacker News ↗