Hacker News new | ask | show | jobs
by jordanlev 2925 days ago
> React (really JSX) solves the single problem of making HTML a part of JavaScript.

This is the crux of the matter. The people who find Vue appealing (myself included) come from the world of design and html+css markup and jQuery. We're not looking to get html into our JavaScript -- rather we're looking to get JavaScript into our html!

There is absolutely no reason to switch from React to Vue if it's working for you (and I don't think anyone in the Vue community would argue with that). But you came from using backbone -- the people who love Vue I think primarily come from using jQuery. We feel the same way about Vue as you do about React, and that's okay! (btw I also use react and also think it's great)

As for staying in React for the rest of your career -- give yourself more credit and hope you'll be around long enough that this isn't true :)

2 comments

> The people who find Vue appealing (myself included) come from the world of design and html+css markup and jQuery.

This is something I've noticed-- spot on. Vue seems popular to people coming from the direction of "augmenting their HTML", whereas React is appealing to me precisely because it's all JavaScript.

Appreciate your comment, it sounds like Vue may be an easier option for you, if you don't want to write JavaScript. However, you should just learn JavaScript, even if you're doing nothing but designing components, will explain why.

I also came from jQuery (Backbone and jQuery was a popular duo, in fact using jQuery in everything was).

The way people wrote apps at one point basically was a stream of jQuery statements, $thing.add('something'), etc.. This created nothing but spaghetti code over time.

Now, we're using React to design extendable components that can be nested, or structured to add more functionality. Check out styled components below to see how much easier it is to combine CSS, HTML into JavaScript. Rebass is built on this as a minimal component library. I know this might be really advanced and you may not adopt any of this, I'm just showing you the latest in what we could be moving toward.

I don't think I would leave React unless JS/HTML/Browsers dramatically changed. The industry is too far into JavaScript code at this point to where I am concerned about job security.

Back to your original point, I don't think Vue would scale well for serious JavaScript heavy apps, so that's why I don't think it's fair to compare it with React, but that's not how it's being discussed, which is some sort of React killer.

[1] https://www.styled-components.com/ [2] https://github.com/jxnblk/rebass

> I don't think Vue would scale well

It kinda bothers me when people say X won't scale (implying that React is somehow special in this regard).

For one thing, we're not talking about things like database throughput where you can actually have scalability bottlenecks.

If we want to talk about scaling maintainability, React is definitely not much of a poster child either, compared to other solutions I've used over the years. We got a new context API only recently to deal with concerns Angular had already accounted for years ago, and things like the Enzyme adapter state of the world is pretty terrible - and don't even get me started on React Router migrations :)

IMHO, one major thing Vue did right that React didn't which has an impact on scaling maintainability is that Vue owns its most important peripherals (data management via vuex, styling via single file components, animations, etc). In my experience, the React model (also adopted by webpack and babel) is a real pain in the ass to support at scale as a web platform engineer, because many times you're at the mercy of some random dude with no connection to the core project and you end up having to settle with bizarre makeshift configurations, fork things or do other nasty things to get around random design direction changes.

> However, you should just learn JavaScript, even if you're doing nothing but designing components, will explain why.

I think you are reading wrong between the lines. There are no vue users who dont know javascript or are not using with it. The concern is really how are you mixing the two. vue is more of js inside html, while react is html inside js.

And its just a matter of opinion. I work on both vue and react apps and personally dislike writing html inside js. But if the project started earlier using react, I am not going to suggest a rewrite just because of this single preference.

lol, I've been a javascript developer (among other things) for over 15 years :)

The point is that some people/teams/environments prefer to not treat everything as a javascript app. Especially in the agency world -- thinking about one's website from a markup/design-first perspective is a totally viable thing. And if you have designers on your team (or for solo practitioners) you sometimes don't want to javascript all the things. It's great that you found an approach that works for you, but it doesn't mean that it's the only best way for everyone and every situation.