by Ashish Singal

How to choose between open source libraries using popularity

Through my career as a product manager, I’ve worked closely with engineers to build many technology products (and even hacked some together myself).

When developing technology products, one of the most critical choices we can make is between competing sets of libraries and frameworks. One key ingredient is relative popularity, for several reasons:

  1. Proxy for the Best. Especially in open source, the “market” is fairly efficient. Developers generally gravitate towards the best technologies and vote with their feet.
  2. Help. While formal documentation is critically important, Stack Overflow questions and Medium tutorials are sometimes even more beneficial to move up the learning curve and to debug. Code snippets and tips from practitioners boost development speed and impact tremendously.
  3. Talent. The more popular a library is, the more likely you’ll be able to find people who know how to use it to help build your product.
  4. Future Enhancements. A vibrant user base and community ensures continued development on the project in the future, reducing the chance that it will become obsolete.

Proxies for Popularity

There are several ways to measure the popularity of OS libraries:

  1. Stack Overflow questions
  2. Github stars
  3. Google Trends

StackShare should also get an honorable mention here as a good way to find popular tools.

Judging Momentum

However, these measures need a time based component. Without taking into account metric momentum, the above measures are purely backward looking — they help inform what was the best technology, not what is or what will be.

Momentum helps us look into the future instead of the past

Therefore, more often, when evaluating competing libraries, I’ll often look at charts of these statistics over time. There are several apps that allow us to do that:

  1. Stack Overflow Trends. Open source tool by Rob McDiarmid. Also directly from Stack Overflow.
  2. Github Star History. Similar tools include StarTrack, Stargraph, and this project. Unfortunately, most use the Github API for this which seems to be quite unreliable and buggy.
  3. Google Trends, of course, works out of the box, but seems somewhat more spiky and less informative than the other two measures.

Google Cloud has also made both Stack Overflow and Github data available as part of their Public Datasets program. And here’s a post that digs into some insights from Stack Overflow.

Example: Flask versus Django

Flask and Django are two popular Python web application frameworks that I personally have a lot of experience with. Flask is lighter weight and more flexible, while Django has much more built in and is more feature rich.

Let’s see how these rank using our methodologies above:

  1. Github Stars: Django currently has 40k stars on Github while Flask has 42k stars — they are neck and neck. I tried several of the Github history trackers, but they all timed out on me.
  2. Stack Overflow: Django has 191k questions, while Flask has 26k questions. The trend shows Flask picking up, but still a long ways away.
  3. Google Trends: Django is currently about twice as popular as Flask, according to Google Trends.
Stack Overflow questions asked by month: Flask v Django
Google Trends search popularity: Flask v Django

Note that of course, relative popularity is only one factor in choosing between libraries. Between Flask and Django, for example, I tend to choose Flask for quick prototyping as well as when I am developing a non traditional app and need a ton of flexibility. I tend to choose Django when I’d like out of the box functionality for things like user accounts, administration, and built in ORM.

Yes, popularity matters!

Hope this helps! Thanks for reading.