A comparison of various JS frameworks using cold hard data

Published on 2013-5-28

I went for lunch with the a friend the other day and he kindly gave me an idea for a blog post about JavaScript frameworks...

I keep an eye on StackOverflow/Github/etc and mentally tot up the popularity of all these JS frameworks...

ooooh, that's a good one that. If we're really going to say "We use FrameworkX" (and I advocate that you never do this, it's a silly thing to do), then let's at least look at some cold hard facts when doing so.

Except let's not just look at popularity, let's think about the support and education and how we could find some metrics to determine these things.

Here are a few assumptions I'm making for this post to work

Number of questions and unanswered questions on StackOverflow

The Stackoverflow guys are amazing, and provide querying capabilities right there on their site, which means I can get some numbers right off the bat for the various frameworks

I ended up with the following parameterised query to get my data

    DECLARE @TagName varchar(128) = '%##TagName##%'

    SELECT COUNT(*) from Posts P
    WHERE P.Id IN (
      SELECT DISTINCT(PostId) from PostTags 
      WHERE PostTags.TagId In (
        SELECT Id From Tags Where TagName LIKE @TagName
      )
    )

    SELECT COUNT(*) from Posts P
    WHERE P.Id IN (
      SELECT DISTINCT(PostId) from PostTags 
      WHERE PostTags.TagId In (
        SELECT Id From Tags Where TagName LIKE @TagName
      )
    ) AND P.AcceptedAnswerId IS NOT NULL

    SELECT SUM(P.AnswerCount) from Posts P
    WHERE P.Id IN (
      SELECT DISTINCT(PostId) from PostTags 
      WHERE PostTags.TagId In (
        SELECT Id From Tags Where TagName LIKE @TagName
      )
    )

Doing this meant I got all the questions with all the tags in the eco-system around that framework, and the data I want is

This in itself is quite interesting, as it doesn't seem like there is a lot of difference between them - although there are a lot more questions about Ember than I was expecting. Knockout is at the top of the heap as far as accept-rate goes but that might be indicative of the .NET-centric community found on StackOverflow?

To get some sense of this data, we could do with looking elsewhere for some data...

Framework popularity

For this, we can head to Github as that's where all sensible OSS projects are hosted these days. Let's have a quick look at some basic stats about these projects. They're all actively using Github to track issues from the look of things so we can gleam a little bit about them from this data.

Framework Stars Forks Issues open Issues closed Pull requests open Pull requests closed
backbone 14148 2713 23 2508 5 1100
angular 9692 1942 655 2037 52 1150
knockout 3708 559 235 738 59 275
ember 6997 1324 196 2487 61 1250

Backbone apparently by far the healthiest project amongst this bunch, with very few issues or pull requests left open (but with a similar amount of activity). I'm surprised a more "mature" project like Angular has so much outstanding on it - but this might just be because of how they use Github issues.

Safety in numbers

This data (when combined with the previous queries) begins to get a little bit more useful if we want to jump to some conclusions already; I'd like to dig deeper into the history of these projects and see who exactly has contributed to them. I don't want to be choosing a framework just because it has a large number of users, I care about who is doing the development too!

To do this, we have the Github API to look at

https://api.github.com/repos/{user}/{repo}/contributors

What do the contribution distributions look like for these projects?

Top 10 contributors and their commit counts

The higher a line stays before it drops down to the 1st, a better indication that there is a healthy spread of committers giving love to the project. By this measure, Angular and Ember seem to be getting some shared love, Backbone is a bit of a one man show and Knockout doesn't really have a lot going on.

A brief history of source

Now I'm looking at committers, we can probably dig a bit deeper and see how this looks over time to get some further insight into the stability of the projects and how this contributor activity looks over time.

I was going to just paste the charts from Github here, but they weren't really representative of activity and the Angular one just plain-old-wasn't-working at the time

I've found a git library for nodejs and will use it to generate a graph of activity over time. What you'd expect to see is that older more stable projects should see a tendency towards less activity and hopefully more contributors as the community fixes issues)

Average commits per person over time per repo

Conclusions

I've got no real desire to draw conclusions off this data, as this was a harmless bit of digging over a spare few hours I had going, I do have some rough comments though:

I'm saying no more on the matter, trololol.

Why not hire me?

I am available for emergency consults, workshops, training and short-term development work anywhere in Europe

C#, JavaScript, Clojure, RavenDB, NodeJS, Architecture review.. etc

Get in touch

blog comments powered by Disqus