5 ms·
I completely disagree on first note, mostly because it's almost all JavaScript. There's very little "React" there. On the second note it's copy-pasted code fro
by ng12 7y ago
I completely disagree on first note, mostly because it's almost all JavaScript. There's very little "React" there.
On the second note it's copy-pasted code from the official Vue docs.
- keithnz 7y agothe best way to describe a UI is in javascript? huh... I wonder why people keep creating markup style languages to abstract away from programming languages for UIs? Basically if you are describing your UI in javascript, maybe that's not a good thing.
- ng12 7y agoI don't really understand what you're talking about. For building a dynamic UI you need JavaScript (or another programming language). Both React and Vue use JavaScript to build their dynamic views. If you're not building a dynamic UI then you don't need either tool.
- keithnz 7y agoIn react that's mostly true, in Vue (and things like WPF) there's a two layers essentially, markup to create bindings to reactive data, and code to define the reactive data ( though vue does let you blur the lines)
- ng12 7y ago> markup to create bindings to reactive data Right, and my argument is building this in JavaScript directly (rather than a HTML-ish/JavaScript-ish template language that gets converted into JavaScript) is a better model.
- keithnz 7y ago@ng12 right, you made a claim, I'm just saying, your claim seems unconvincing, and the example you gave doesn't seem to make for good evidence of your claim.
- ng12 7y agoYou're not making it clear why it's unconvincing. Let me summarize my post: Vue had to fundamentally introduce a new concept (which developers, myself included, find confusing [1]) to solve a problem you can easily solve in React without any additional APIs. React does this very much by design [2] and it's a huge part of the reason why I like it more than Vue. 1. https://vuejsdevelopers.com/2017/10/02/vue-js-scoped-slots/ https://vuejsdevelopers.com/2017/10/02/vue-js-scoped-slots/ 2. https://2014.jsconf.eu/speakers/sebastian-markbage-minimal-api-surface-area-learning-patterns-instead-of-frameworks.html https://2014.jsconf.eu/speakers/sebastian-markbage-minimal-a...
- ratww 7y agoThis only makes sense for people who learned to program using React and only ever programmed in it. Not saying that's your case. Vue.js uses templates, and the idea of slots already existed in other template languages for years. Angular, ERB/Rails, Razor, Django, Handlebars, Jinja, WPF, even some wikis: all those have the same concept, maybe implemented diferently. On the other hand, React uses JSX, which is novel and wasn't really used anywhere else before. JSX also has the disadvantage of requiring a very complex toolchain (Babel and Webpack etc), something that Vue.js doesn't require.
- ng12 7y agoIf all the other frameworks jumped off a bridge, would yours jump too? :) The real win here, even if you're familiar with other template solutions, is that you never have to ask the question "How do I do X in template solution Y?". React's JSX "templates" can be fully described in a single sentence: write some (X)HTML and use curly brackets to insert a JavaScript statement that evaluates to a primitive. There are no other concepts to learn provided you know JS and HTML -- and having spent lots of time introducing React to developers of various levels of front-end experience that's something I've come to really appreciate.
- ratww 7y ago> If all the other frameworks jumped off a bridge, would yours jump too? :) That's moving the goalposts. Your point was that Vue invented a new concept and that was a negative. I'm just mentioning how it wasn't an invention at all, it was already a popular concept present in multiple other systems. For people used to templating languages the concept of a slot is not confusing, maybe you just weren't familiar with it? And it is false to say that JSX doesn't introduce new concepts and rules. The way JS and HTML interact inside JSX is not intuitive at all, and you can't use a lot of JS constructs inside JS, such as `for` loops and `ifs`. Of course there are other ways to solve it, but it's far from intuitive (and the fact that Babel returns "Unexpected token" when you do it doesn't help). For what is worth, passing components inside props in React is also not intuitive, unless someone shows you or tell you it's possible. When you do a few React tutorials you pick it, of course, and that's exactly the same for Vue.js. Maybe you just find React easier because you learned it first? Maybe do a few tutorial lessons before judging it? Just because something is different or not familiar to you doesn't mean it's worse or is difficult. Both frameworks are great, there's no need to pit one against each other.
- Scarbutt 7y agoIs that MVVM or like Razor in asp.net core?