Re:The self-fulfilling prophecy of React
by jeremycarter on Friday September 09, 2022 @02:22AM
(#32775921)
Python is the last thing you want in the browser. The sooner everyone's love affair with Python ends the better.
Re:The self-fulfilling prophecy of React
by throwaway1851 on Friday September 09, 2022 @03:06AM
(#32776205)
Python has its flaws (package management and the GIL come to mind). But the language itself is just beautiful, and _designed_. It makes it so many common tasks expressible in compact, readable code. I’d be willing to jump through some hoops to use it on the front and back.
Re:The self-fulfilling prophecy of React
by frosted-flakes on Friday September 09, 2022 @12:02AM
(#32775150)
What do you dislike about JSX? It's just a tree of function calls.
Re:The self-fulfilling prophecy of React
by throwaway1851 on Friday September 09, 2022 @12:48AM
(#32775412)
Just the visual appearance. It’s so chaotic. I’m sure it’s very powerful, and that’s why people like it. I just don’t have a very high tolerance for clutter.
Re:The self-fulfilling prophecy of React
by frosted-flakes on Friday September 09, 2022 @12:57AM
(#32775467)
It looks almost exactly like HTML though? The only difference is wrapping curly brackets around expressions. I admit that if you embed long expressions directly in the JSX it can chaotic, but I tend to assign these expressions to variables first, then put the variable in the JSX. Or break it up into another component.
Re:The self-fulfilling prophecy of React
by throwaway1851 on Friday September 09, 2022 @01:52AM
(#32775759)
I don’t think it does when the markup you’re generating gets more complex. At least, not compared to Vue templates.
What I like about Vue is that you can work up a static design, then cut and paste chunks into single file components, add in a few :attr=“someVar” bindings, some handlebars, and you’re done with the template part. You can also copy and paste and rearrange the markup very easily. It’s a nice workflow and it makes it easy to see and manipulate the structure of the markup without having to think about the JS too much.
I imagine if you enjoy writing JS, then it makes sense to make everything a function and do it all in JS.
Re:The self-fulfilling prophecy of React
by localvoid on Friday September 09, 2022 @01:01AM
(#32775491)
> I’m sure it’s very powerful
JSX is only appealing to a webdev community. Modern native react-like UI libraries are perfectly fine without XML-like syntaxes: Flutter[1], Jetpack Compose[2], SwiftUI[3].
I recently spent some time learning Vue 3, and I’m a little less enamored. The composition API is nice for not requiring deeply nested code inside a giant object literal. But having my code littered with .value is ugly and a source of endless bugs. (You also don’t always need .value, such as when referencing a Pinia store. Ugh.) I looked into the pending “Reactivity Transform”, but it too introduces weird surprises and seems like its issues may be unsolvable.
Bottom line: I hope and pray for the day WASM allows Python to get a decent footing in the browser environment.