Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> SwiftUI is basically React implemented in Apple's proprietary language rather than a preprocessed JavaScript-XML hybrid.

This is completely false. Not one shred of truth in it. The similarities between React and SwiftUI end at both being component-based UI libraries, just like plenty of others (Cocoa, Vue, Ember, Ext JS, Svelte, Qt, do I need to go on?—some of which provide various components out of the box, others of which don’t). Beyond that, they work in radically different ways and the way you will achieve things is radically different too. Just look at the avocado toast example and see how true this is.



I honestly don't know what you mean. The SwiftUI avocado toast example looks very similar to React but very different from e.g. Cocoa or Qt.


It looks more like React than the likes of Cocoa and Qt, but if you’re comparing that aspect of its style then it looks like at least Vue, Ember and Svelte too. The way it works is very different, and the way it’ll make you write code is fairly different too, inasmuch as it essentially has its own layout and rendering model, and doesn’t use HTML and CSS. (SwiftWebUI renders to HTML, but being SwiftUI stuff it’s not using HTML simply rather than that being what you work with in your UI code; and styling works in a radically different way.)


React is independent of layout and rendering models, it's not in any way tied to HTML or CSS.

AFAICT the way SwiftUI works is basically the same as React.


You’re right in that it looks similar to React, but it is also true that this kind of API is (declarative component tree composition) now very wide-spread and popular, and React was not the first to implement or adopt it (I feel like the person referencing Qt maybe meant Qt Markup Language specifically).

The way all of these frameworks differ from each other is both very slight in superficial details (think two-way binding or slots) and very, very strong in the basic implementation (i.e. the diffing or reconciliation algorithm).

So, yes, a lot of these look similar these days. But saying that they work the same is oversimplification in my opinion.


When I referred to Qt I was meaning Qt in general, rather than QML. If you want a similar style of how you write code, then yes, QML is closer to this area than general Qt.


Yes, React is nominally independent of HTML and is independent of CSS. SwiftUI is not independent of these things, but implements its own thing altogether.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: