Reaper: When Deleting Code Is as Important as Writing It
4 min read

Reaper: When Deleting Code Is as Important as Writing It

740 words

In my experience with mobile development, I’ve seen how apps become increasingly complex and projects grow uncontrollably. I remember perfectly that feeling of having thousands of lines of code and not being sure what was really being used and what wasn’t.

That’s why I was so struck by the tool that Sentry (formerly from Emerge Tools) just released as open source: Reaper. An SDK that does something that sounds simple but is tremendously useful: find dead code in your mobile applications.

What Exactly Is Dead Code?

Dead code is code that’s there, takes up space, but never executes. It’s like having a room at home full of things you’ll “someday use” but have been collecting dust for years. In the mobile development world this is especially problematic because:

  • It increases app size: Every KB counts, especially in markets where slow connections are common
  • It complicates maintenance: More code to review, more surface area for bugs
  • It slows down builds: More code to compile and process
  • It confuses developers: It’s easy to get lost in code that seems important but isn’t used

How Reaper Works

What’s interesting about Reaper is that it doesn’t use static analysis (like Periphery or other tools), but real-time analysis. That is, it monitors how users actually use your app to identify what code never gets touched.

The process is elegantly simple:

  1. First step: A script analyzes your binary and generates a set of all types Reaper can track
  2. Second step: You collect data from real users using the app in production
  3. Result: The difference between both sets tells you what code has never been used

On iOS

In iOS, Reaper takes advantage of metadata that already exists in the Objective-C and Swift runtime. It uses the RW_INITIALIZED bit that activates the first time a class is accessed. It’s brilliant because it adds no runtime overhead to your app.

On Android

In Android the approach is different because they don’t have access to those runtime metadata. So they instrument classes at build time, adding calls to logMethodEntry in the <clinit> and <init> methods of each class.

Why I Find This Fascinating

I’ve been saying for years that “for every minute you dedicate to planning and study, you’ll need 2 minutes less of development.” Reaper fits perfectly into this philosophy, but applied to code maintenance.

In my times developing for mobile, this tool would have saved me headaches. I remember projects where we had features we thought were being used, but in reality users never touched. Or classes that were left orphaned after refactorings.

The Irony of Modern Development

The original Sentry article mentions something that made me reflect: AI tools are accelerating development speed, but they’re also increasing code duplication and affecting stability. Studies like Google DORA’s Impact of Generative AI in Software Development show productivity improvements, but also negative impacts on stability.

It’s as if we’re writing code faster, but maintaining quality is becoming more difficult.

That’s why tools like Reaper seem so important to me. It’s not just about deleting dead code, but about really understanding how your application is used in the real world.

Is It Worth Implementing?

If you’re developing for mobile, especially in large teams or apps with a lot of history, I’d say yes. It’s open source, for both iOS and Android, and you can use it with your own backend.

They’ve even created a sample server so you can get started quickly with your own implementation.

Companies like Duolingo have already used it to eliminate 1% of their iOS codebase. It might seem like little, but in large applications, that 1% can be the difference between an agile app and one that staggers under its own weight.

Conclusion

Although I’m now more focused on backend and systems, tools like Reaper still seem fascinating to me. They remind us that writing code is only half the job; maintaining, understanding, and cleaning it is just as important.

As the classic development saying goes: “The best code is the code that doesn’t exist.” And Reaper helps you find exactly what code shouldn’t exist.

Have you used similar tools? Are you considering implementing something like this in your mobile projects? I’d love to hear your experience.


If you liked this article, you can follow my reflections on development and technology at my blog. And if you work with mobile development, definitely check out Reaper - it’s a tool I wish I’d had years ago.

Comments

Latest Posts

4 min

793 words

I’ve seen how certain standards and tools become indispensable when working with data. And if there’s one thing we’ve learned over these years, it’s that JSON is everywhere: APIs, logs, configurations, NoSQL databases… The question is no longer whether you’ll work with JSON, but when you’ll face that 15-level nested structure that makes you sigh.

The Problem We’ve All Lived Through

How many times have you had to write something like this?

5 min

1020 words

I have been using Claude Code daily for months, and there is one configuration that has completely changed how it works with my code. It is not a new plugin, a more powerful model, or a magic prompt. It is something that has existed since 2016 and that most developers use without knowing it every time they open VS Code: the Language Server Protocol (LSP).

Karan Bansal published an excellent article explaining in detail how to enable LSP in Claude Code and why it matters. After trying it, I can confirm the difference is real and significant.

5 min

905 words

Throughout my career, I’ve seen many things change. I’ve gone from Borland to Visual Studio, from vi to Sublime Text, from Sublime to VS Code… And believe me, each change was a deliberate decision that cost me weeks of adaptation. But what’s happening now with AI tools is something completely different.

I’ve found myself using Copilot in the morning, trying Cursor in the afternoon, and checking out Claude Code before going to bed. And I’m not alone. Developers have gone from being faithful as dogs to our tools to being… well, promiscuous.

3 min

548 words

When working on large projects, it’s common to have test suites that can take several minutes to run. And when one of those tests fails early in the execution, it’s frustrating to wait for all the others to complete just to see the full results.

Jest includes a feature I’ve found very useful in development: the bail option, which allows stopping test execution after a certain number of failures. It’s one of those features that once you know and start using, you don’t understand how you lived without it.