Stabilize, Modularize, Modernize: Scaling Slack’s Mobile Codebases

When do you need to overhaul a large code base to address tech debt? What is the best way to address widespread inconsistencies and outdated patterns? How can you make significant architectural improvements to a complex application while still continuing to ship features? These were questions we grappled with at the beginning of 2020, when…

Overview

The article discusses Slack's initiative to stabilize, modularize, and modernize its mobile codebases to address technical debt that has hindered development. It outlines the challenges faced, the decision-making process behind the overhaul, and the goals set for the stabilization phase of the project.

What You'll Learn

1

How to effectively reduce technical debt in mobile codebases

2

Why modularization is essential for large-scale applications

3

When to choose refactoring over a complete rewrite of a codebase

Prerequisites & Requirements

  • Understanding of mobile application architecture and design patterns
  • Experience with iOS and Android development(optional)

Key Questions Answered

What were the main goals of the stabilization phase for Slack's mobile codebases?
The main goals included porting remaining Objective-C code to Swift, finishing migrations to data access libraries, and completing the migration to a native networking library on iOS. For Android, goals involved splitting the monolithic API call interface, migrating to SQLDelight, and standardizing on the repository pattern.
How did Slack address technical debt in its mobile applications?
Slack initiated Project Duplo to reduce technical debt by stabilizing the codebases, which involved addressing key issues identified by developers, using metrics to track progress, and focusing on critical areas for improvement.
What challenges did Slack face with its mobile codebases before the initiative?
Challenges included monolithic app targets leading to long build times, tangled interdependencies, and inconsistent design patterns. This complexity hindered development speed and reliability, necessitating a major refactor.
What metrics were used to track progress during the stabilization phase?
Metrics included tracking the number of lines of Objective-C remaining, completion of technology migrations, and the reduction in build times. Automated scripts and dashboards were utilized to visualize progress and identify areas needing attention.

Key Statistics & Figures

Lines of Objective-C code remaining
80,000 lines
This represented 15% of the codebase at the start of the stabilization phase.

Technologies & Tools

Some links below are affiliate links. We may earn a commission if you make a purchase.

Programming Language
Swift
Used for migrating the iOS codebase from Objective-C to enhance performance and modernize the application.
Database
Sqldelight
Adopted for safer and more efficient SQLite queries in the Android application.

Key Actionable Insights

1
Focus on modularizing your application to improve development speed and reduce interdependencies.
By breaking down monolithic applications into smaller, manageable components, teams can work independently and reduce build times, which is crucial for scaling development efforts.
2
Prioritize the migration of legacy code to modern languages and frameworks.
Migrating from Objective-C to Swift on iOS not only enhances performance but also allows developers to utilize modern language features, improving overall code quality and maintainability.
3
Implement clear metrics to track progress on technical debt reduction initiatives.
Using automated scripts and dashboards to visualize progress helps teams stay on track and make informed decisions about resource allocation during large refactor projects.

Common Pitfalls

1
Underestimating the complexity of refactoring a large codebase can lead to stalled projects.
Many teams may overlook the time and resources required for thorough refactoring, leading to incomplete migrations and ongoing technical debt if not properly planned.

Related Concepts

Mobile Application Architecture
Technical Debt Management
Refactoring Strategies
Modular Programming