6 ms·
As it turns out, React / CSS / the document-object-model are popular for more reasons than “it works on different computers.” Who knew!
by ketzo 5y ago
As it turns out, React / CSS / the document-object-model are popular for more reasons than “it works on different computers.” Who knew!
- knome 5y agoI expect these additional reasons can largely be summed up as "I already know it from using it in the browser, so let's use that"
- dymk 5y agoYou'd probably be wrong! Let me introduce you to https://github.com/ocornut/imgui https://github.com/ocornut/imgui
- junon 5y agoWhich doesn't use React, CSS, or a DOM...? What's your point? ImGUI is imperative UI programming. DOMs are declarative.
- dymk 5y agoImGui makes UI programming declarative in structure the exact same way React makes UI programming declarative. React brings to the table is the general concept of immediate mode UI programming. So does ImGUI. Reaching for React doesn't mean it's the only thing the programmers knew, it means it's a general pattern that arises in UI programming.
- junon 5y agoNo, it absolutely does not. ImGUI is a completely, totally different model of GUI programming.
- inopinatus 5y agoI think it’s a little unfair that you’ve been so downvoted (at the time of writing), because the old phrase about hammers and nails is super applicable to software development, and the icloud team may very well know react better than cocoa.
- marcosdumay 5y agoActually, web pages are a very declarative GUI, with an amount of reflexivity and editability that should be on any declarative GUI framework, but normally isn't. Those properties open up the possibility of abstracting things and making very powerful libraries over it. There is nothing else as powerful out there. Yet, everybody stops at plain react. So whatever is the reason for the success, it's not that one I pointed.
- __del__ 5y agowho knew? it sneaked up on us. we spent decades wedging compatibility shims into gaping functionality holes, while heroic visionaries of the web as a platform toiled and bargained to bring us the tools we needed for modularity, performance, and a modicum of basic platform services. all while making sure <TD STYLE=FLOAT:RIGHT> continued to work.
- olliej 5y agoApple has been using web views for apps for more than a decade - recognizing that such an object is more generally usable than just "a browser" was a motivation for WebView (now WKWebView) existing as a platform API from the earliest days of WebKit being a thing that existed (The logical extreme being the original WebView API exposed an objc interface to the DOM)
- chrismorgan 5y agoAnd Windows pushed in this direction heavily back around 1999–2005, with things like https://en.wikipedia.org/wiki/HTML_Application https://en.wikipedia.org/wiki/HTML_Application and IE being used quite extensively in Windows Explorer in Windows XP and a couple of versions around it. (In fact, if it weren’t for the whole antitrust situation around the inclusion of IE, I suspect they would have gone even further in on web content on the desktop rather than letting it lie fallow for something like fifteen years.) There’s a reason you get system colours and fonts in CSS: they’ve been round since the ’90s. You certainly wouldn’t get such useful and flexible stuff being added now. There are very strong parallels in a lot of the progress that’s been happening in the past few years with what happened twenty years before. Probably the most obvious example is dark mode: computers had that twenty years before, then it got lost somewhere along the way, then it gets reinvented in an only slightly different form (both more and less useful: it’s far more restricted, to just one alternative theme rather than many, but for the web you can actually design for it in CSS alone this time). Cycles.
- olliej 5y agoMy recollection of using the old windows HTML control was that it was very useful outside of being a basic content view - obviously there was subsequent additions to the web that made some functionality in webkit available, but the WebView controls in my extremely limited experience seemed a much better fit for minor content views in apps. Of course that's all kind of moot because the important point is that there's a large different between a native app that uses a webview (or the windows/linux equivalent) to display some content, and a cut down browser view trying to act like a native application. Admittedly a number of the bugs in electron apps are a byproduct of their use of chromium which is very much a Mac-second engine and the actual API requires host apps to do much more work for system integration, which is a valid choice: it gives the host app much more flexibility in handling things. The down side is there are some things that apps shouldn't be trying to reimplement themselves.
- heavyset_go 5y agoI'd bet that the reason they're using React is because it's cheaper and easier to find front-end developers for the task.
- ketzo 5y agoI’ve been hearing this on HN and similar forums for what feels like years now: “Electron/web-based GUIs are only popular because it’s easy to find devs in those ecosystems” Have we considered asking why it’s so much easier to find React devs? Why such a huge, huge majority of UI development today takes place on the web? I’m a front end web developer. I’m very biased. But I’m a little tired of the narrative that “the right way to make a UI is to build it natively, but everyone wants to take the easy way out.” Perhaps the explanation is that native GUI frameworks simply haven’t kept up in terms of developer experience. And if you spend some time exploring them, I think that becomes very obvious very quickly.
- kitsunesoba 5y ago> Perhaps the explanation is that native GUI frameworks simply haven’t kept up in terms of developer experience. That depends on what one values, in my opinion. Whenever I start poking around with front end web stuff it makes me want to tear my hair out. Not because it isn't technically capable, but it all feels so slapdash, duct-taped, and chaotic compared to what I'm used to writing AppKit/UIKit, even if some aspects of the experience with front end web tech are nicer. Things are solidifying around React which helps, but for me at least, it's still a hard sell to trade away the positive aspects of native development just to get the positive aspects of front end web dev.
- rhodysurf 5y agoI’m guessing you haven’t tried building something serious with SwiftUI then. Because for me React is a million times more polished than SwiftUI. I was a native dev before I got into web stuff. The Apple APIs for native GUIs are so good, but they are extremely verbose, and with swift now they are closed source. It’s just not as easy (or fun tbh) to build things with