5 ms·
It's weird that there are 49 comments and not a single mention of React. SwiftUI is basically React implemented in Apple's proprietary language rather than a p
by pavlov 7y ago
It's weird that there are 49 comments and not a single mention of React.
SwiftUI is basically React implemented in Apple's proprietary language rather than a preprocessed JavaScript-XML hybrid [1]. More options is a good thing, but it hardly seems revolutionary.
[1] This works much better than it sounds like. I'm a long-term C/C++/Obj-C programmer and was very sceptical of JSX, but React is actually very nice to use. The toolchain is kind of byzantine but seems to be settling slowly on reasonable defaults.
- andrekandre 7y agowell, to be fair, react wasn’t exactly completely new with its idea either... what’s old is new again
- yogthos 7y agoI find using React is a strictly better experience from ClojureScript. There's way less code, no JSX, the toolchain is straight forward, you get reliable hot loading for free, and it actually outperforms plain React in some cases. https://github.com/ClojureTO/JS-Workshop https://github.com/ClojureTO/JS-Workshop https://www.freecodecamp.org/news/a-realworld-comparison-of-front-end-frameworks-with-benchmarks-2019-update-4be0d3c78075/ https://www.freecodecamp.org/news/a-realworld-comparison-of-...
- srfilipek 7y ago> Apple's proprietary language While it is heavily funded and used by Apple, I would never call it "proprietary". It's open source. https://swift.org/about/#swiftorg-and-open-source https://swift.org/about/#swiftorg-and-open-source
- pavlov 7y agoApple makes all relevant decisions on language design and direction. Swift is Apple's proprietary language in the same sense as C# is Microsoft's.
- chrismorgan 7y ago> 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.
- pavlov 7y agoI 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.
- chrismorgan 7y agoIt 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.)
- pavlov 7y agoReact 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.
- ch_sm 7y agoYou’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.