r/reactjs • • Jun 19 '18

Github Stars !== Usage: React is still blowing Vue and Angular Away

https://zendev.com/2018/06/19/react-usage-beating-vue-angular.html
178 Upvotes

32 comments sorted by

94

u/evilpingwin Jun 19 '18

this sparked a huge amount of debate about which framework is "really" more popular

I don't think it did, not by anyone you would take seriously. I mean, Evan literally replied to Dan's tweet saying he hoped people wouldn't take it too seriously and stated that React was used more widely (It might not have been an actual 'reply').

Dan was really just congratulating the Vue folk for building a cool tool and a great community. The framework/ library tribalism is annoying and isn't conducive to improving the ecosystem.

I just wish we could focus on building cool stuff without any of the bullshit. I'm happy to know that the smart people building these great tools don't consider it to be a competition and are really supportive of one another.

11

u/ritaPitaMeterMaid Jun 19 '18

framework/library tribalism is annoying

I while heartedly agree. But paradoxically (or hypocritically?) I often steer people to React. I used Vue for a year and eventually switched everything away from it. I respect it, but I never want to work on a project that uses it for more than a small section of the site or prototyping.

I feel like I’ve done a decent job of avoiding tribalism but it’s really hard because I do have strong opinions.

6

u/evilpingwin Jun 19 '18 edited Jun 19 '18

Having preferred tools is fine in my opinion, it's when we get dogmatic about things and dismiss them without knowing much about them. Or following what others say without being critical (this is super common).

It's also perfectly reasonable to not look into new things because the rate of change and release of new tools is too fast. But in that situation you shouldn't be arguing against tools you don't have a knowledge of but you can still argue for the things you know about.

That's my opinion anyway. I think developers have a hard time saying 'sorry, I don't understand that so I can't comment' or 'sorry, i haven't used that tool so I can't advise you'. We pride ourselves on knowing things , admitting you don't know things to people can sometimes be hard.

Luckily I'm an idiot.

3

u/ritaPitaMeterMaid Jun 20 '18

This resonates a lot with me. It drives me nuts to argue with someone who has never actually built anything with a system but they are hellbent on seeing its total destruction.

0

u/[deleted] Jun 21 '18

[deleted]

7

u/ritaPitaMeterMaid Jun 21 '18

Many reasons, but they can be distilled into two distinct categories:

  1. I prefer HTML in my JavaScript over JavaScript on my HTML.

Vue essentially uses custom attributes to handle logic in HTML. Where in React you would use .map() to loop over an array and render a table, in Vue you use custom attributes (similar to Angular) v-for=“todo in todos”. This is so obtuse to me. I have a programming language, it is called JavaScript, I don’t an abstraction to hide something that is already very accessible. Additionally, I found if I wanted to do anything extra with the data before it got passed to the drop down meant I couldn’t actually use the model tool, I had to manually build out the logic myself, at which point I’m now coding in a templating language, which is to me is a big issue. In other words, I’m using a pseudo-language that is written inside strings. I found the process immensely frustrating.

I compare this to JSX which takes a thing that is not very accessible, writing HTML in a readable format in JavaScript, and it provides a very much needed abstraction.

Vue also has the condition that it remain compatible the HTML custom element spec. The way you render, import, and utilize components are all different depending on the context you’re in. When things have similar but different naming structures I always get confused. I found it difficult to keep up when refactoring components.

Vue forcibly separates any JavaScript you write from any HTML your write. There are template tags for HTML and a script(? Can’t remember what it’s called, it’s been over a year) section for your JS. To me, this defeats the purpose of a JavaScript based UI library. I’m here to write JS. If I want to define logic directly in my component because this is a simple presentational component, let me.

2) Vue pushes you to use tools that make it easy to pick up and learn but quickly lose value in the face of anything moderately complicated.

It gives you some really interesting tools. As an example, Vue has the concept of a model binding. Let’s say you have a drop down, you would bind that to an array in Vue’s equivalence of props and gets saved to its equivalence of state. No need to make functions and manually set handlers. But what happens if you need to do something more complicated, like do some extra processing or change the way those values get computed? I found that process to be unintuitive and overly complicated. Essentially, anything more than the simple examples Vue provides on its website I found to be major pain to implement.

The process of getting data up to a parent was also really awkward. In React you just pass a function down that sets state and the child calls it. In Vue you emit events. I’m a big fan of the event/observer pattern, I think it gets under or incorrectly utilized, but I don’t think it is appropriate here.

Because of these things, I don’t feel it scales well. Once we got to more than two components deep I felt like I had a rat’s nest. I was never confident in the code I was writing and I feel a primary purpose of a library is to increase confidence.

In conclusion, nothing Vue does is “wrong.” It just goes against all of my philosophies on how HTML, JS, and CSS should be treated in the frontend. I respect it. But I never want to work with it ever again.

0

u/[deleted] Jun 21 '18

[deleted]

1

u/ritaPitaMeterMaid Jun 21 '18

That question isn't really about Vue but applies to all UI libraries and frameworks.

The short answer is no.

The long answer is no, because keeping two systems relatively in sync will eventually become complicated if it gets large enough. Remember that the frontend exists as presentation layer. This presentation layer needs data to do its job. As needs become more complicated the type of data you are getting from the backend becomes more nuanced. An example of this is paginated results from a REST API. You have to keep track of the number of results you have out of the total.

Whether you use Vue, React, or Angular you cannot escape this. But that's not the goal. This is where using an architecture that's appropriate for your system is important. It's also important to remember that you don't need to exactly mimic the database in your state manager, you only need to keep things together enough so that you can reliably show the correct data.

Most people I encounter that hit this part of designing their system seem to get frustrated because they can no longer just do state.someProperty.entities.map(). The promise of frontend libraries and their ecosystem is not that you will avoid complication, it is that they will arm you with an appropriate toolset to deal with it.

4

u/[deleted] Jun 19 '18

I think the tribalism is unavoidable. That is the nature of open source's design making process, which is fundamentally democratic. No, we can't just all live in bubbles and build whatever we want because dependencies do exist.

1

u/steve-globs Jun 20 '18

Framework tribalism ... LOL

18

u/BenjiSponge Jun 19 '18 edited Jun 19 '18

I wonder if there's a way to extract the usefulness of stars while avoiding the popularity contest.

Stars are kind of silly anyways. They're both "bookmarks" (in that they show up in your list of "starred" repos) and appreciation, which is kind of strange to me.

Historically, I've always used them as bookmarks and a way to express what I'm interested in to GitHub (which seems to be their primary intended use, though both are listed) and never as appreciation, though I've changed recently. So there was actually a time where I had Vue starred and React unstarred, despite never using Vue and working with React both as a hobbyist and as a professional for years, for the same reason that I have Godbolt compiler explorer bookmarked and Reddit is not (because I'm never going to forget the name of Reddit or what it is).

I actually think better than stars would be two different anonymous systems: A bookmark system, and a "tip" system, which could include $0 tips (and also make it easier to financially support projects you love with just a mouse-click, something I've wanted for a long time).

It's actually kind of curious to me that people haven't been botting GitHub stars a la Facebook likes or Instagram followers.

6

u/vexii Jun 19 '18

It's actually kind of curious to me that people haven't been botting GitHub stars a la Facebook likes or Instagram followers.

i remember reading about a guy that botted 3k stars on a hobby project and had better luck getting an intership becouse of it

11

u/Console-DOT-N00b Jun 19 '18

I don't think I've "used" 98% of what I star.

It's a snakes on a plane type thing. "Neat"....wanders off

2

u/truh Jun 20 '18

Yeah, I usually use stars as bookmarks, when I might want to check out a repo on a later day.

5

u/friendshrimp Jun 19 '18

Really fun seeing this back and forth on Vue and react

1

u/nschubach Jun 20 '18

The biggest thing I don't like about vue is the damn template logic (v-for, v-if...). I know you don't have to use it but it was one of the pain points with AngularJS as well and since it's in the official docs, someone is going to use it and someone else is going to have to support it.

1

u/[deleted] Oct 14 '18

I love these things about Vue. What's the problem with them?

1

u/nschubach Oct 15 '18

It's another domain and specialization. With JSX (React, etc.) you just use plain JavaScript. With these template logic constructs, you have another layer of complication there. What scope is being used? What loop am I in? It's more overhead that you have to learn and troubleshoot.

8

u/AdvancedPizza Jun 19 '18

They are all tools. Who cares??

0

u/[deleted] Jun 20 '18

[deleted]

2

u/AdvancedPizza Jun 20 '18

Sure. It's just the contentious headline that particularly bugs me.

Healthy competition is a great innovation driver, but shitposts like this that folks put energy into just baffles the mind, when they could be out building shit. Who has time to write flame articles about X > Y framework.

Get out there and build and contribute!

2

u/robberviet Jun 20 '18 edited Jun 20 '18

LOL isn't that just a gag? Someone with proper knowledge will know what is really widely used and what is not.

To me Github star is just like bookmark: Something sounds cool, I will mark it for later use.

May be a "nested-star" (sum of stars of projects who has React/Vue as dependencies) might give more insight.

2

u/kitsunekyo Jun 19 '18

npm downloads also have no meaning. evan of vue once showed stats from their devtools, which gives a more"real" view on how many devs are actively developing with vue.

just because a package has a lot of downloads doesnt mean its actively used by a lot of people or in a lot of projects that be used in production

what i see with react is that novice web devs hear about react, try it for a tutorial and then never touch it again because its unnecessarily complicated for the simplest things.

class binding, two way data binding, conditionals, reactivity, separation of code are all things that are very important for smaller projects but annoying to do with react, in my opinion.

react can do more as you have to manually handle a lot of stuff. so it has a different use case. vue shines with simplicity, clean code and onboarding time. but since react has a headstart, the ecosystem is bigger and is more mature. but also has a lot of issues vue has long learned from. i'm not talking about angular because angular is so scattered and broken that nobody except for enterprises that already bet on it want to use it.

1

u/BenjiSponge Jun 19 '18

npm downloads also have no meaning. evan of vue once showed stats from their devtools, which gives a more"real" view on how many devs are actively developing with vue.

I agree, though more downloads often implies more usages within a CI environment which often means more people are actively developing with it in a professional context, which may be more meaningful depending on your use-case.

All of them are stupid reasons to pick one or the other. If you're picking within the top 3, relative popularity doesn't matter.

1

u/kitsunekyo Jun 20 '18

i find i specifically stupid to make github stars, downloads or anything an main argument why you should choose one framework over the other.

popularity only means if you have a good ecosystem. your choice should be made solely by checking what each individual framework provides.

1

u/ryno Jun 19 '18

BUT STARS == LIKES MAN ;)

1

u/Axohn Jun 19 '18

Star to save the baby seals !

1

u/silversik Jun 25 '18

Ridiculous article. Just like you said, jquery beat react

1

u/BenZed Jun 19 '18

This is minor and pedantic, but I would say this would be proper usage of the equivalent equality operator, instead of the identical equality operator:

framework.stars != framework.usage

Of course they're not identical.

3

u/BenjiSponge Jun 19 '18

I don't think it really matters. In any reasonable world, stars is a number, though usage is unclear.

The real statement isn't whether they're == or ===, it's whether they can be coerced or converted without losing information, and the statement is that they cannot be.

ideas.evaluate('using pseudo-code to describe things that should be described in human language').quality === IdeaQuality.POOR;

1

u/BenZed Jun 19 '18

users.getItem('BenjiSponge') instanceof Nerd

2

u/BenjiSponge Jun 19 '18

1

u/BenZed Jun 20 '18

lol I called you a nerd in code.

It was meant as a compliment :)

-5

u/[deleted] Jun 19 '18

usage !== best choice

-1

u/aManIsNoOneEither Jun 19 '18

Stop 👏 using 👏 github 👏 stars 👏 as 👏 metrics