4 ms·
Am I the only developer that feels that React ... and perhaps the whole web paradigm ... is about the worst way to think about and develop client GUIs? After u
by TheMagicHorsey 6y ago
Am I the only developer that feels that React ... and perhaps the whole web paradigm ... is about the worst way to think about and develop client GUIs?
After using Google's new Flutter framework (which is built to develop cross platform apps: iOS, Android, Web, embedded) I felt like I had my eyes open. The structure seems so much more logical and easy to navigate.
The Web (and React) paradigm of putting some code in HTML, some in CSS, and then some in JS, just seems like a step backwards to me after using Flutter where everything is just code. Designers build in Adobe XD or Figma, and then they hit export, and it dumps out FLutter code that a developer can directly read and incorporate into her project. There isn't a bewildering array of different things all being processed by different other things ... dumping out yet more things. Its just code to binary ... that's it.
And that's another thing ... I like the code to binary direct link. React Native's JS logic + bridge to native always seemed like such an inefficient shim. And seeing the framerate of widgets in Flutter its pretty clear we have been leaving some performance on the table for the convenience of making everything in Javascript.
Having said that, I'm sure Flutter on the web is as bulky as any other JS framework, as there it has to run on JS/HTML/CSS like everyone else.
- fuzzy2 6y agoReact doesn't have HTML templates though…? You can also have CSS-in-JS if you really want.
- TheMagicHorsey 6y agoWhatever it's called ... JSX ... fact is you have to dive out of javascript to describe your UI in a different syntax, that's the point.
- fuzzy2 6y agoIt’s still not HTML. It’s just syntactic sugar for function calls. You don’t have to use it either way; you can just call `React.createElement` directly if you don’t like JSX.
- eyelidlessness 6y agoJSX is not HTML, even though its syntax is very similar. It’s a data structure that’s renderer-agnostic. It can be rendered to HTML, or to a live DOM, or to other outputs. IIRC, Netflix uses React to render at least some components on entirely non-web interfaces like smart TVs. To me, that fact is what makes React (and other libraries like Preact that have a similar interface) more compelling than the template-oriented alternatives. As far as I’m aware, Flutter takes basically the same approach, just with different syntax. I believe the same is true of SwiftUI. And Elm, and the various UI libraries for Clojure. And as another comment mentioned, you can use a variety of CSS-in-JS approaches, which at least last time I looked is actually the more common approach in the React community. Add in TypeScript (or whatever static type system in whatever compile to JS language), and you’re basically comparing bike sheds at this point.
- TheMagicHorsey 6y agoSemantics. The fact is you need to change syntax to describe your layout, instead of just using the syntax of the language you are already coding in.
- hombre_fatal 6y agoFlutter has even more abstraction than what most people are using for web clients. That doesn't come for free, though it tends to always look like 100% upside until you actually use it and see the trade-offs it makes. Ruby on Rails also used to attract a lot of comments like yours until people realized the trade-offs. Btw, if Flutter makes the web dev paradigm look bad, then I wonder what you think of the iOS/Android/desktop client paradigms where you don't even get much choice like you have on the web. Like using Core Data's "ORM". You're essentially hoping Flutter spares you from ever having to drill any deeper than the Flutter abstraction on each of your deploy targets which simply doesn't yet match reality. And of all the client dev experiences, it's the web that has the options closest to Flutter, so it's not the one I'd damn first.
- TheMagicHorsey 6y agoFlutter has a very good plugin architecture. You don't actually have to use their widgets if you don't want to. And as for being restricted to the prevailing platform paradigm ... you have as much freedom as the platform gives you. For some things Flutter can't provide miracles ... like to access specific device hardware you are going to have to build a native bridge ... but in the end Flutter is building a binary that is ... as much as possible ... standalone. It even reinvents GUI components instead of bridging to the prevailing OS ones, touch input instead of using the native one, etc., so that you have more control (if you want it).