by Ashish Singal
How to choose between open source libraries using popularity
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:
- 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.
- 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.
- 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.
- 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:
StackShare should also get an honorable mention here as a good way to find popular tools.
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.
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:
- Stack Overflow Trends. Open source tool by Rob McDiarmid. Also directly from Stack Overflow.
- 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.
- Google Trends, of course, works out of the box, but seems somewhat more spiky and less informative than the other two measures.
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:
- 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.
- Stack Overflow: Django has 191k questions, while Flask has 26k questions. The trend shows Flask picking up, but still a long ways away.
- Google Trends: Django is currently about twice as popular as Flask, according to Google Trends.
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.
Hope this helps! Thanks for reading.