4 ms·
I don’t come from a JS background, and JS makes me very angry every time I use it. But it’s unavoidable if you want to build something on the web. I tried to pi
by throwaway1851 4y ago
I don’t come from a JS background, and JS makes me very angry every time I use it. But it’s unavoidable if you want to build something on the web. I tried to pick up React a few years ago for a project, saw the JSX, and put it right back down. At the time, Vue’s emphasis on HTML templates was comforting and approachable, since I like HTML and its simplicity and visual structure. So I tried Vue, and found it was easy to go from toy examples to real, working projects with no major gotchas.
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.
- frosted-flakes 4y agoWhat do you dislike about JSX? It's just a tree of function calls.
- throwaway1851 4y agoJust 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.
- frosted-flakes 4y agoIt 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.
- throwaway1851 4y agoI 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.
- localvoid 4y ago> 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]. 1. https://flutter.dev/ https://flutter.dev/ 2. https://developer.android.com/jetpack/compose https://developer.android.com/jetpack/compose 3. https://developer.apple.com/xcode/swiftui/ https://developer.apple.com/xcode/swiftui/
- jeremycarter 4y agoPython is the last thing you want in the browser. The sooner everyone's love affair with Python ends the better.
- throwaway1851 4y agoPython 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.