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

StackOverflow is popular enough for the data to be representative (it's the de-facto place to ask programming questions)

The number of questions/un-answered questions is indicative of support

Github is popular enough for the data to be representative

The number of projects, and the number of stars on a project is indicative of popularity/use

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

How many questions are there?

How many of those questions have accepted answers?

How mant answers do we get on average per question? Framework Questions Answered % Average answers per question backbone 8863 5741 64.7% 1.42 angular 5498 3401 61.8% 1.32 knockout 5624 3917 69.6% 1.31 ember 10086 6426 63.71% 1.63

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:

EmberJS has a third of the followers on Github to Backbone, a similar amount of activity on Github but more questions on StackOverflow - is this an indication as to it being hard to pick up or use? It also has a high amount of code churn still - presumably because it's still quite an immature project (I didn't realise how much younger it was than the others!)

Backbone is clearly reaching some sort of maturity, with few issues left open on Github, commit activity subsiding and some sort of stability being reached. It doesn't have the high number of core contributors of other projects but there are plenty of people willing to fix bugs still. The support rate on StackOverflow is about the same as the other projects and while it might be the most popular project on Github it doesn't have that many questions considering that huge size.

Knockout doesn't really get the love that other frameworks do, this might be due to its conception taking place in the .NET community or because most people steer clear of it for some reason. That said - if you're using it and asking for help on StackOverflow you're more likely to get help than on the other frameworks. The response rate on issues/pull requests is high which means the core contributors are quite active even if there aren't many of them.

Angular is waaaaay older than I thought it was, so it staggers me the amount of issues pending closure. It has a very solid contributor base and it does seem as though the commit-rate is reaching some sort of stability. It does however have the lowest accept-rate on StackOverflow so read into that what you will.

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