Live data from Hacker News

Vue.js vs. React

vuejs.org

431–440 of 486 posts

Re: Vue.js vs. React

#431

Earlier quoted context omitted.

Because you don't really understand separation of concerns

I think I understand it quite well having worked for more than a decade on complex systems. I can't say the same for you if you think that putting some logic in the presentation layer like the example above is a good thing. I would always transform my domain in the model object while the presentation layer should only present the transformed model. Using a map function directly in JSX is a sure recipe for disaster in…

He is right taught. You are allowed to have all the logic you want in your presentation layer. As long as it is presentation logic this perfect. If it is "Business logic" then this is wrong. Have you realised than having a if statement is already "logic"? Template system that don't have if statement are absolute trash IMHO.

Re: Vue.js vs. React

#432

In this thread people are fighting about their _opinions_ why they use Vue.js or React. And why X is really better than Y. In reality these programmers don't want to have the feeling they might have made the wrong choice when they used X instead of Y. The idea that they might have taken the poorer choice hurts so much that they need to defend their decision so heavily while in reality taking ReactJS or Vue.js is like…

You can't compare react and vue with pizza and pasta. Pizza and pasta are two finished products, while react and vue are two different ways of building the same product. Your comparison doesn't make sense at all to me.

Say you're about to cook pizza or pasta, you use flour and tomato for both. Comparison not 100% off IMO.

Re: Vue.js vs. React

#433

Earlier quoted context omitted.

> It's like writing shitty PHP code without templates. For me, it's the other way around. I feel like you can still separate the logic and markup, but instead of the template engine syntax you can just JavaScript. From the top of my head, I can at least remember six template engines' syntax I've learned: Smarty (PHP), Mustache, Blade (PHP), EJS, Angular and another custom template engine. When I tried React I was so…

> Another template engine syntax? No, thank you. JSX is another templating language. One built on top of JavaScript rather than HTML.

Been using angular for years, and recently picked up react -- as time goes on the HTML based DSL within templates starts to approach JavaScript

Re: Vue.js vs. React

#434
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…

> It will take you 2 weeks of work to make a new React app have the same feature set as an Ember app

You're probably right about this. But it's not always the whole story - maintain and grow your app for a year, and you may find your experience shifts dramatically.

Disclaimer: I haven't used Ember for anything but the tutorial, and I hear it's pretty good these days.

Re: Vue.js vs. React

#435
post #237
post #222

Earlier quoted context omitted.

What makes Marko better then all others in your opinion? Apart from speed which is the only thing I could gather on the Google. And why are there no interest? Because it is from Ebay? I mean look at the reply and no one even want to touch on it.

Marko is faster and lighter. Also the syntax of single file components is more minimalistic than Vue, which is a good thing. I'd say there is no interest because the single file components are quite new, and before that the project was focused on being a really fast templating engine. https://github.com/marko-js/templating-benchmarks Check this presentation about Marko, I found it illuminating. https://www.youtube.co…

Thanks for sharing this. I'd never heard of Marko until you brought it up and it looks amazing so far.

Re: Vue.js vs. React

#436
post #352

Earlier quoted context omitted.

Also you can do with just JavaScript. With render-function. h('ul', [ h('li', 'one'), h('li', 'two') ]) And use native array methods instead of v-for v-if and filtering data with component methods

> With render-function. This is even worse as for me. Generally the JSX/React.createElement approach itself and the fact that many people like the idea make me cry. Do people like it just because it's given by FB?

The syntax to me is irrelevant. The important bit is to use as much JS and as little string/DSL template as possible.

Why? Because tooling. Anything that's in JavaScript can be linted with ESLint, can be typed with Flow or TypeScript, is subject to dead code elimination by my minifier, can be shared via ES6 Modules/CommonJS wihin my project or NPM with no magic. All editors that understand JavaScript will give me all of their shinies (eg: tell me if I screwed up a conditional) without needing special framework specific support.

JSX itself used to cause these problems too (but createElement and the factories of old did not), but now that they're pervasive and that anything that supports ES6 supports JSX, I get all of these benefits for free.

The moment I hop into template/DSL land, I either hope there's a plugin with all the same benefits (often there is not), or I'm sad.

Note that people who use React + JSX and make stuff like "if" or "else" components fall into these problems too, so those have to be fully avoided.

Re: Vue.js vs. React

#437
post #66

Earlier quoted context omitted.

Could you explain your rationale? I highly doubt that a very large number of people are hand-writing render functions... I personally gave up on React and only picked it up several months later after finding out that using it with just a script embed was exceedingly painful.

You can include a babel script that compiles everything on load. There's a performance hit but people do it because it's easy. Edit: more information: https://github.com/babel/babel-standalone/blob/master/README...

Babel-standalone was put together as part of the pretty good reactjs.net .Net implementation of react, after the 'official' version of babel-in-the-browser was killed off.

It's /really/ not intended for use in prod.

.

Edit. I kinda sent off on a stream of conciseness about reactjs.net here, feel free to ignore this bit.... :D

Infact, as well made as it is and despite using reactjs.net heavily for the last couple of years, the only time i would be inclined to use it on a new app is to leverage the universal rendering, or if your react app is just freaking massive and takes forever to run a build - otherwise you may aswell just throw everything at webpack --watch via iisnode or regular 'ole vanilla node.

Then again we had to make a bunch of changes to the package itself to fully support our bundling (we don't like cassette so we made our own) and to support multiple server-side bundles, none of which are agnostic enough to warrant a PR, so upgrading reactjs.net to a more recent version is a hassle, making me slightly biased against using it ;)

Re: Vue.js vs. React

#438
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"?

The problem with two-way binding is that people use more than one source of truth and blame that questionable (to not use stronger words) decision on the framework.

At least that's what I've seen it come down to.

Re: Vue.js vs. React

#439

Earlier quoted context omitted.

Not to mention that if a section of markup gets too big, you can break that down to it's own method that returns tiny snippets so you can have really simple methods that end up creating the more complex end result i.e. _renderXOrY = (thing) => { return thing.isX ? : } //inside the render method {listOfThings.map(thing => this._renderXOrY(thing))} I personally prefer this because when creating the top level of a compo…

Right, being able to compose, test, structure and develop my HTML in the same way I'm doing it with my application code is for me the main Reason for never wanting to go back to anything that's based on classic string-like templating. The latter always felt as clunky as programming without a proper function abstraction.

For me it's quite the opposite. I find that so confusing when you look at html in JavaScript and don't know right away what the result will be. It's like were back in 2002 doing PHP.

Re: Vue.js vs. React

#440
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 work in a coworking space in Seattle. Most of the startups here use React and a few Angular. Not one, that I know, uses Vue. This is a fairly large coworking space and while I don't know every company's stack, the reach of React is impressive considering it wasn't that long ago that Angular dominated.
Post reply on HN