Live data from Hacker News

Vue.js vs. React

vuejs.org

361–370 of 486 posts

Re: Vue.js vs. React

#361

Vue.js is going to win because simplicity and easier bootstrapping matter. In the same time Vue.js is powerful enough for building the complex and scalable apps.

Onboarding green devs into anything more than a simple Vue app is a lot more complex than a React app of similar complexity, from my experience. The simplicity of the nested, inception style architecture of React makes it super easy to onboard and up-ramp.

Couldn't disagree more. Or perhaps, more accurately, I think the scenario you are referring to isn't the one that matters.

It's not about taking a massively existing complex application written using one of VueJS or React and onboarding someone completely green into it. Adoption is about "how easily can I incrementally adopt this technology into my legacy app". And the problem is that React is nearly unusable without switching entirely over to a Webpack / transpiler system and learning JSX, which makes it almost a non-starter for someone who isn't planning a major rewrite of their legacy app front end. By contrast VueJS "just works" after dropping a simple JS bundle into a page and the first templates you write are barely distinguishable from regular HTML. You can start by just enhancing the odd page element here and there, and slowly build up to a fully based VueJS app.

Re: Vue.js vs. React

#362

Vue.js is going to win because simplicity and easier bootstrapping matter. In the same time Vue.js is powerful enough for building the complex and scalable apps.

CRA or Next.js make bootstrapping incredibly simple, and they're production ready.

Bootstrapping matters more for the сurious and not very experienced individuals, think like Vue is a new jQuery.

Re: Vue.js vs. React

#364
post #256

Earlier quoted context omitted.

Having 1k components sort of seems like a bug rather than a feature. How does that avoid becoming left-pad hell again and how would you expect any sort of quality control out of that?

Not really (I'm not even sure of a feature of "what" would it be?)- it is not like you have to use any of that - you could make same criticism for NPM, pypi etc. Webcomponents.org is just a repository, nothing more. If you want quality then you just use components backed by reputable authors - I guess that is the universal rule for development in general.

That's sort of my point. Having ten different implementations of, for example, a data table, each using its own variant of what button template it prefers seems like exactly the kind of hole npm dug itself into. That doesn't seem very desirable for a UI framework that is shipped to clients and demands polish.

Sure, you don't have to use it, but it's the main selling point of polymer. It seems nice in theory but npm also seemed nice in theory.

Re: Vue.js vs. React

#365
post #337
post #277

Earlier quoted context omitted.

Ok I think I figured out how to use a template with a slot in the spinner component: {{this.error}} Then in the template the option line becomes {{option}} Not too bad. Guess I'll have to come up with a new example of what Vue templates can't do now!

I wonder if the JS snippets in those attributes is syntax checked at build time or run time.

Vue templates are compiled into render functions. They are checked when the template is compiled. If you are using a build process, then that would be at build time.

Re: Vue.js vs. React

#366

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…

You have tons of well established platform tools that will give you way more power at your fingertips if you wish so. Have you tried QT or Xamarin?

>Have you tried QT or Xamarin?

These are for desktop/mobile apps right? If so, yeah, there are other options as well.

Was thinking more something like this, but for SPAs.

Re: Vue.js vs. React

#367
post #132

We moved away from React to Vue about 8 months ago and everyone on the team is a lot happier. First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. It also forces you to use a lot of boilerplate like bind(), Object.keys(), etc. Another problem with React is that it only really solves o…

> First reason is we hate JSX.

I feel like this is often the reason people dislike React, and it mostly comes out of a misunderstanding of JSX and es6 syntax and interaction. Why do I say this? Because I've yet to hear an argument that came after a statement like above which was actually true in any way. Most arguments that come after actually expose the fact that the author of the statement simply doesn't understand the syntax usually because they've never really bothered to try to use it and instead are simply turned off by something new in their code.

> It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading

This is quite simply false, it doesn't force you to do any of these things. A lot of people seem to think it does which again comes from a misunderstanding of the syntax. You're quite able to either embed your logic into the JSX or not, whichever you prefer. I most often see people lean toward the former unless the logic in question is extremely complex in which case it could be argued it's best being removed from the markup anyway. But JSX itself does not force you either way.

> It's like writing shitty PHP code without templates

I simply don't see a viable comparison here at all.

> It also forces you to use a lot of boilerplate like bind(), Object.keys(), etc.

Again, this is simply untrue. In fact I'd argue that if you're using lots of .binds you're doing it wrong. .binds inside your render function are actually bad practice due to the fact that they mean you're adding overhead of creating new bound functions as each .bind returns a brand new function every time your render tree executes. The overhead of such is probably negligible, however it's still inefficient and cumbersome and thus is bad practice.

As for Object.keys() - While I share your dislike of the overuse of this particular method, I'd love an example of where you think this is forced on you by JSX because for the life of me I can't think of one.

> There is no official React router

This I completely agree with, it is annoying, and I too am not a fan of react-router. However it's so easy to create your own routing setup and/or plug and play other lightweight ones that I don't usually think of it as a particular plus/minus point when comparing to frameworks like Vue.

Re: Vue.js vs. React

#368
post #361

Earlier quoted context omitted.

Onboarding green devs into anything more than a simple Vue app is a lot more complex than a React app of similar complexity, from my experience. The simplicity of the nested, inception style architecture of React makes it super easy to onboard and up-ramp.

Couldn't disagree more. Or perhaps, more accurately, I think the scenario you are referring to isn't the one that matters. It's not about taking a massively existing complex application written using one of VueJS or React and onboarding someone completely green into it. Adoption is about "how easily can I incrementally adopt this technology into my legacy app". And the problem is that React is nearly unusable without…

> learning JSX

Not just learning, JSX/React.createElement approach is the hell itself, it increases the technical debt every time you use it, but some people prefer to make a blind eye to this. When juniors come to work with React I guess it makes them think that React way is the only way, but it's more like the 10 years old PHP code.

Let's imagine that for some reason in 2-3 years there will be a silver bullet like framework. So most likely hipsters will be going to switch to it and I'd like to see how they will be cherry-picking all the template's parts from the JS/JSX code to the single holistic template (I don't think the sliver bullet like framework will follow the mixing template with code ideas).

Re: Vue.js vs. React

#369

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…

To be fair, JSX has its own idiosyncracies too for templating, such as className, htmlFor, and the obnoxious attribute name for dynamically inserted html. It is not immune to the criticism that it requires learning.

You're right, but it's one of those things that you can basically treat it as html until you can't - and the points at which you can't are quite specific and other than className - are rarely used. Also the dynamically inserted html param being obnoxious is by design - they don't want you to dynamically insert html, and that's a good thing. Honestly you shouldn't ever be using that param.

Re: Vue.js vs. React

#370
post #132

We moved away from React to Vue about 8 months ago and everyone on the team is a lot happier. First reason is we hate JSX. It forces you to write loops, conditionals, etc, outside of the markup you are currently writing/reading. It's like writing shitty PHP code without templates. It also forces you to use a lot of boilerplate like bind(), Object.keys(), etc. Another problem with React is that it only really solves o…

Jsx is one of the best parts of react. No way I can go back string templates and it's own languages.

Absolutely agree. Most front-end meetups/conferences I've been to have had the majority of people there expressing a dislike for JSX. I still don't understand that to this day, to me JSX is one of the best things about React.
Post reply on HN