Live data from Hacker News

Vue.js vs. React

vuejs.org

311–320 of 486 posts

Re: Vue.js vs. React

#311
post #199

Earlier quoted context omitted.

I have been building web apps for 19+ years. I like many of the frameworks out there but for some reason I HATE React. I think JSX is a huge turnoff for me. I just can't get past html in javascript. It feels wrong. With that said, there are so many VERY smart people embracing React, so I am always questioning my "hate". Maybe one day I will change my mind. I haven't use Vue but watched/read about it and seems very co…

For a long time, people have been saying "separation of concerns" to support the idea of keeping HTML, JavaScript, and CSS in separate files. The problem with that is that the document, application state, and styling is all highly coupled when dealing with web apps . Web pages which are content based are fine with these being separate, changes to one don't necessarily affect another. For web pages, the separation of…

While it didn't start out this way, these days Ember apps lean heavily on components and all of the apps I work on use a pod structure that groups each component into a directory containing a component.js, a template.hbs, and a style.scss file. This maintains the spirit of "components should be self-contained" while not having to define html and css within javascript. Ember has React to thank for the idea, but I prefer Ember's implementation.

Re: Vue.js vs. React

#312
post #232

Earlier quoted context omitted.

> What's wrong with looping this way? The problem IMO is that it's harder to read and write than: {{num}} That's Vue's syntax, but any other templating language is more readable to me than JSX.

Templates have always been nice for basic examples. But now what happens if you only want to show odd numbers in listItem? It's not obviously clear how to do that in this example. Then you start adding in filters or Angular pipes. And the syntax grows in complexity until it becomes unwieldy. If you know the basic rules of JS, you already know how to achieve this with JSX. There's no need to go read the docs.

Haven't used VueJS but the obvious thing to me would be to do your data transformations before hitting the view code - separating view code from business logic.

So is this really a problem?

Re: Vue.js vs. React

#313
post #108

I've built semi-large applications in both Vue.js and React. I like both but prefer React. For me Vue.js is like a light-weight Angular 1, in a good way. It's very intuitive and you can start working immediately. It does however easily end up in confusion about where the state lives with the two-way binding. I've run into a lot of implicit state changes wrecking havoc. The declarative nature of React definitely wins…

I've been in this gig for years upon years and I still don't see what's terrible about two way binding. Can someone actually justify it without handwaving statements like "you'll notice at scale", or red herrings like "Angular is slow"?

It's pretty much an issue of getting to a "stable" state, which means that model stabilizes to a certain value after all the actions by user and code. That can be a problem with 2way binding and sometimes it causes very subtle bugs, but it boils down to the infamous event storm. So that's why they gave up on 2way binding and made it more optional and deliberate

Re: Vue.js vs. React

#314
post #232
post #203

Earlier quoted context omitted.

I'm not sure I follow. To use the basic example from the link, as opposed to this: const listItems = numbers.map((number) => {number} ); return ( {listItems} ); What's wrong with looping this way?: return ( {numbers.map((num, i) => {num} )} )

> What's wrong with looping this way? The problem IMO is that it's harder to read and write than: {{num}} That's Vue's syntax, but any other templating language is more readable to me than JSX.

I guess it's taste, but that's far less readable than the JSX with `.map` example to me. JSX is easier to use and read because you just use the JS constructs that you already know rather than a whole new DSL.

Re: Vue.js vs. React

#315

Earlier quoted context omitted.

Templates have always been nice for basic examples. But now what happens if you only want to show odd numbers in listItem? It's not obviously clear how to do that in this example. Then you start adding in filters or Angular pipes. And the syntax grows in complexity until it becomes unwieldy. If you know the basic rules of JS, you already know how to achieve this with JSX. There's no need to go read the docs.

Haven't used VueJS but the obvious thing to me would be to do your data transformations before hitting the view code - separating view code from business logic. So is this really a problem?

You don't always want to transform data, sometimes this is merely a UI concern...as in filtering, sorting, etc.

Re: Vue.js vs. React

#316
post #108

I've built semi-large applications in both Vue.js and React. I like both but prefer React. For me Vue.js is like a light-weight Angular 1, in a good way. It's very intuitive and you can start working immediately. It does however easily end up in confusion about where the state lives with the two-way binding. I've run into a lot of implicit state changes wrecking havoc. The declarative nature of React definitely wins…

I have been building web apps for 19+ years. I like many of the frameworks out there but for some reason I HATE React. I think JSX is a huge turnoff for me. I just can't get past html in javascript. It feels wrong. With that said, there are so many VERY smart people embracing React, so I am always questioning my "hate". Maybe one day I will change my mind. I haven't use Vue but watched/read about it and seems very co…

I worked with Ember for a few months and I like it a lot - it definitely deserves more recognition. One thing that frustrated me a lot in Ember was the run loop. The docs suggest that you don't have to worry about the run loop at all and its merely an implementation detail, yet we had to constantly us Ember.run, Ember.run.schedule, etc. all over the app. But of course in order to know which Ember.run methods to use, you end up diving deeply into the implementation details of the framework itself.

Re: Vue.js vs. React

#317

Earlier quoted context omitted.

> I can at least remember six template engines' syntax I've learned... TBH, in 2017, I'm not sure why we're still hand-generating HTML with any template language. Instead, I'd really like to see a framework that gets away from the idea of HTML templating altogether and presents a true component/properties model on top of a canvas with flexible, property-driven layout options. I think the intense UI-demands of progres…

See Elm.

I feel that the focus on graphics has faded a bit in the most recent versions.

When I last gave it a try I had to manually generated the HTML document but without a (at least of of the box) syntax like jsx. If I recall correctly graphics is still there, but it's mainly used for games

Re: Vue.js vs. React

#318
post #46

You'll see quotes in this thread like "The demand for both React and Vue.js is growing tremendously" thrown around. It's good to check out npm install stats to get an unopinionated comparison. https://npm-stat.com/charts.html?package=react&package=vue&p... In reality, React is downloaded roughly 4-5x more than angular and 7-8x more than Vue. In August so far, React has 75% market share among these three libs. Interes…

I really don't want Vue to become another React. React used to be a single dependency in the browser and now it is difficult to find examples and discussions that don't require downloading npm and all these other components.

What do you have against npm install create-react-app?

Re: Vue.js vs. React

#319
post #11

Vue is good for simple things. But it do not shines for complex apps and sometime makes it even harder than it should be. React can appears complicated when beginning, but it pays off on complex apps.

i'd say it's quite the opposite. vue makes complex apps easy to write, where react makes it look complex all the time.

Agreed, the learning curve to build more complex, larger applications in vuejs was considerably less than with react.

Re: Vue.js vs. React

#320
post #146

Earlier quoted context omitted.

You can make it cleaner: Button

Vue allows you to use Pug syntax in your templates, so this can be even simpler: button(:disabled='isButtonDisabled') Button div(:id='`list-${id}`") form(@submit.prevent='onSubmit') a(@click='doSomething')

I'm sorry but that is hideous.

JSX is incredibly simple. Why would you do that to yourself and other devs?

Post reply on HN