Building Reddit’s iOS and Android app
· Summarized
Key takeaways
- Reddit's mobile codebase contains approximately 2.5 million lines of code, showcasing the complexity and scale of the apps.
- The transition to a modern tech stack called Core Stack is pivotal for Reddit's mobile engineering, allowing for better organization and scalability.
- Automated testing has significantly evolved at Reddit, leading to improved reliability and performance of mobile applications.
- AI tools are being utilized to enhance workflows, albeit with mixed efficacy regarding code generation.
- The migration from REST to GraphQL involved challenges but ultimately resulted in performance benefits and a better user experience.
- Creating a supportive culture for platform engineering helps engineers thrive and encourages experimentation to solve real problems.
Summary
Reddit’s Mobile Codebase Scale and Team Structure
The episode opens with a detailed discussion about the sheer scale of Reddit's mobile codebase, highlighting that there are approximately 2.5 million lines of code for both Android and iOS, consisting of over 500 screens and many modules. Both mobile platform teams boast around 200 engineers, with Lauren, Brandon, and Eric detailing how these engineers are structured into various feature teams that include dedicated backend engineers and other specialists. This organization allows for efficient mobilization of resources across platforms.
Transitioning to Modern Architecture: Core Stack
In 2021, Reddit shifted its focus to modernize its mobile applications, leading to an increase in hiring for native mobile engineers and the development of the 'Core Stack.' The Core Stack serves as a new tech stack designed to overcome prior limitations. The team discusses the transition from the traditional MVP architecture to a newer MVVM architecture, which enhances the development and scalability of their applications.
Automated Testing Evolution
Automated testing strategies underwent a significant transformation at Reddit. The discussion outlines how the mobile team evolved its testing practices to improve the reliability of the apps, bringing in a diverse range of tests that ensure performance and UI integrity. The speakers also highlight the challenges they faced in implementing a robust testing framework and the ongoing efforts to refine this process.
AI in Development Workflows
The engineers share their personal experiences in leveraging AI tools within their workflows. They express mixed feelings about their effectiveness in generating high-quality code but find value in their ability to assist with problem-solving and rapid prototyping. Interestingly, they draw a balance on the potential of AI to aid developers rather than replace their expertise, especially in the context of mobile development.
Challenges and Insights from the Mobile Modernization Effort
As the conversation progresses, the team discusses the hurdles overcome during the modernization project. They provide insights regarding the complications from migrating from REST to GraphQL, stating that initially, the integration led to increased latency. However, through collaboration with backend teams and persevering through the challenges, they were able to realize the benefits of GraphQL, leading to improved performance and better user experience.
Future of Platform Engineering and Developer Experience
The episode concludes with a contemplation on the future of platform engineering within Reddit, emphasizing the importance of hiring practices that prioritize developers’ ability to communicate and address internal challenges. They assert the need for a culture of experimentation and resilience against failures, fostering a constructive environment in which engineers can thrive. They also discuss the potential for development within larger organizations as engineers seek to transition to platform teams.
Sponsors
- Graphite · The AI developer productivity platform that helps developers create, review, and merge smaller code changes, stay unblocked, and ship faster.
- Sentry · Error and performance monitoring for developers.
Show notes
Supported by Our Partners
• Graphite — The AI developer productivity platform.
• Sentry — Error and performance monitoring for developers.
—
Reddit’s native mobile apps are more complex than most of us would assume: both the iOS and Android apps are about 2.5 million lines of code, have 500+ screens, and a total of around 200 native iOS and Android engineers work on them.
But it wasn’t always like this.
In 2021, Reddit started to double down on hiring native mobile engineers, and they quietly rebuilt the Android and iOS apps from the ground up. The team introduced a new tech stack called the “Core Stack” – all the while users remained largely unaware of the changes. What drove this overhaul, and how did the team pull it off?
In this episode of The Pragmatic Engineer, I’m joined by three engineers from Reddit’s mobile platform team who led this work: Lauren Darcey (Head of Mobile Platform), Brandon Kobilansky (iOS Platform Lead), and Eric Kuck (Principal Android Engineer). We discuss how the team transitioned to a modern architecture, revamped their testing strategy, improved developer experience – while they also greatly improved the app’s user experience.
We also get into:
• How Reddit structures its mobile teams—and why iOS and Android remain intentionally separate
• The scale of Reddit’s mobile codebase and how it affects compile time
• The shift from MVP to MVVM architecture
• Why Reddit took a bet on Jetpack Compose, but decided (initially) against using SwiftUI
• How automated testing evolved at Reddit
• Reddit’s approach to server-driven-mobile-UI
• What the mobile platforms team looks for in a new engineering hire
• Reddit’s platform team’s culture of experimentation and embracing failure
• And much more!
If you are interested in large-scale rewrites or native mobile engineering challenges: this episode is for you.
—
Timestamps
(00:00) Intro
(02:04) The scale of the Android code base
(02:42) The scale of the iOS code base
(03:26) What the compile time is for both Android and iOS
(05:33) The size of the mobile platform teams
(09:00) Why Reddit has so many mobile engineers
(11:28) The different types of testing done in the mobile platform
(13:20) The benefits and drawbacks of testing
(17:00) How Eric, Brandon, and Lauren use AI in their workflows
(20:50) Why Reddit grew its mobile teams in 2021
(26:50) Reddit’s modern tech stack, Corestack
(28:48) Why Reddit shifted from MVP architecture to MVVM
(30:22) The architecture on the iOS side
(32:08) The new design system
(30:55) The impact of migrating from Rust to GraphQL
(38:20) How the backend drove the GraphQL migration and why it was worth the pain
(43:17) Why the iOS team is replacing SliceKit with SwiftUI
(48:08) Why the Android team took a bet on Compose
(51:25) How teams experiment with server-driven UI—when it worked, and when it did not
(54:30) Why server-driven UI isn’t taking off, and why Lauren still thinks it could work
(59:25) The ways that Reddit’s modernization has paid off, both in DevX and UX
(1:07:15) The overall modernization philosophy; fixing pain points
(1:09:10) What the mobile platforms team looks for in a new engineering hire
(1:16:00) Why startups may be the best place to get experience
(1:17:00) Why platform teams need to feel safe to fail
(1:20:30) Rapid fire round
—
The Pragmatic Engineer deepdives relevant for this episode:
• The platform and program split at Uber
• Why and how Notion went native on iOS and Android
• Cross-platform mobile development
—
See the transcript and other references from the episode at https://newsletter.pragmaticengineer.com/podcast
—
Production and marketing by https://penname.co/. For inquiries about sponsoring the podcast, email podcast@pragmaticengineer.com.
Get full access to The Pragmatic Engineer at newsletter.pragmaticengineer.com/subscribe
Follow this show on AudioBrevity and new episodes get summarized for you. Create a free account