4 ms·
That's not what declarative is, though, "imperative" or OO frameworks have layout managers (too). There is some confusion, i.e. a spectrum (declarative first o
by smaudet 4y ago
That's not what declarative is, though, "imperative" or OO frameworks have layout managers (too).
There is some confusion, i.e. a spectrum (declarative first or imperative first, somewhere in the middle), about what is meant by declarative e.g. this article mentions android as "imperative"
https://medium.com/everything-full-stack/declarative-ui-what-how-and-why-13e092a7516f https://medium.com/everything-full-stack/declarative-ui-what...
While this one claims android is by default declarative.
http://www.cberr.us/tech_writings/essays/declarative_vs_programmatic_ui.html http://www.cberr.us/tech_writings/essays/declarative_vs_prog...
Having a DOM or element tree with layout applied doesn't make you declarative, this is more what is meant by declarative:
https://en.wikipedia.org/wiki/QML https://en.wikipedia.org/wiki/QML
or
https://www.solidjs.com/examples/counter https://www.solidjs.com/examples/counter
I.e. "low code" coding with little actual behavior specified.
- Pulcinella 4y agoIn addition to layout managers, UIKit and AppKit both have constraint based layouts if you use Autolayout. Autolayout itself follows the declarative paradigm (well unless you use it to manually and directly set every X, Y, width, and height constraint, then I guess you are using imperatively). You can declare that a button be two thirds the width of its parent, for example. It’s also fast (well I guess I mean between Apple’s optimizations and modern cpu speeds, there is only noticeable latency when you do intentionally ridiculous things like trying to layout one view per pixel with nested, relative constraints). It’s kind of funny comparing it to SwiftUI’s new .layout API. It’s the exact opposite! A declarative UI framework with an imperative layout option.