As you may have heard, we’ve been hard at work redesigning our desktop for the past year. In our previous four redesign blog posts, u/Amg137 and u/hueylewisandthesnoos talked about why we're redesigning, moderation in the redesign, our approach to design, and Reddit’s evolution. Today, Reddit’s Engineering team invites you “under the hood” look at how we’re giving a long overdue update to Reddit’s core stack.
Spoiler: There’s going to be a fair bit of programming jargon in this post, but I promise we’ll get through it together.
History and Journey
For most of Reddit's history, the core engineering team supporting the site has been extremely small. Over its first five years, Reddit’s engineering team was comprised of just six employees. While there were some big engineering milestones in the early days—a complete rewrite from Lisp to Python in 2006, then another Python rewrite (aka “r2”) in 2008, when we introduced jQuery. Much of the code that Reddit is running on right now is code that u/spez wrote about ten years ago.
Given Reddit’s historically tiny eng team (at one point it was literally just u/spladug), our code wasn’t always ideal… But before I get into how we've gone about fixing that, I thought it'd be fun to ask some of the engineers who have been here longest to share a few highlights:
- u/spladug: “For a while now, ‘The controller was now a giant mass of tendrils with an exciting twist’ has been the description of the r2 repository on GitHub.”
- u/KeyserSosa: “After being gone for 5 years and having first come back, I discovered that (unsurprisingly) part of the code review process is to use ‘git blame’ to figure out who last touched some code so they can be pulled into a code review. A couple of days in, I got pinged on a code review for some JS changes that were coming because I was the last one to edit the file (one of the more core JS files we had). Keeping in mind that during most of those intervening years I had switched from being ‘full stack’ to being pretty much focused on backend/infra/data, I was somewhat surprised (and depressed) to be looking at my old JS again. I let the reviewee (a senior web dev) know that in the future that he has carte blanche to make changes to anything in JS that has my blame on it because I know for a fact that that version of me was winging it and probably didn't know what I was doing.”
- u/ketralnis: “I worked at Reddit from 2008 to 2011, then took a break and came back in 2016. When I returned my first project was to work on some performance stuff in our query caching. One piece was clearly incorrect in a way that had me concerned that the damage had spread elsewhere. I looked up who wrote it so I could go ask them what the deal was… and it was me.”
Luckily, Reddit's engineering team has grown a lot since those days, with most of that growth in the past two years. At our team’s current size, we're finally able to execute on a lot of the ideas you’ve given us over the years for fixes, moderation improvements (like mod mode, bulk mod actions and removal reasons), and new features (like inline images in text posts and submit validation). But even with a larger team, our ancient code base has made it extremely difficult to do this quickly and effectively.
Enter the redesign, the latest and most challenging rewrite of Reddit’s desktop code to date.
Designing Engineering Networks that Neutralize Inevitable Snags
When we set out to rewrite our code to solve these problems, we wanted to make sure we weren't just fixing small, isolated issues but creating a new, more modern frontend stack that allowed our engineering team to be nimble—with a componentized architecture and the scalability necessary to handle Reddit’s 330 million monthly users.
But above all, we wanted to use the rewrite as an opportunity to increase “developer velocity,” or the amount of time it takes an engineer to ship a fix or new feature. No more “git blame” for decade-old code. Just a giant mass of tendrils, shipping faster than ever.
The New Tech Stack
These are the three main components we use in the redesign today:
- Redux is a predictable state container for JS apps. It greatly simplifies state management and has good performance.
Just the Beginning
With our new tech stack, we were able to ship a basic rewrite of our desktop site by September of last year. We’ve built a ton of features since then, addressing feedback we’ve gotten from a steadily growing number of users (well, a mostly steady number…). So far, we’ve shipped over 150 features, we've fixed over 1,400 bugs, and we're moving forward at a rate of ~20 features and 200+ bugs per month.
We know we still have work to do as Reddit has a very long tail of features. Fortunately, our team is already working on the majority of the most requested items (like nightmode and keyboard shortcuts), so you can expect a lot more updates from our team as more users begin to see the redesign—and because of our engineers’ work rewriting our stack over the past year, now we can ship these updates faster and more efficiently.
Over the past few weeks, we have given all moderators and beta users access to the redesign. Next week we plan to begin adding more users to make sure we can support a bigger user base on our new codebase. Users will have the option to keep the current design as their default if they wish—we do not want to force the redesign on anyone who doesn’t want to use it.
Thank you to everyone who’s helped test, reported bugs, and given feedback on the redesign so far; all of this helps a lot.
PS: We’re still hiring. 🙂