Rewrite or Refactor?
Exploring the path of full-scale application modernization


(4 comments)
May 27th 2020


Note: I've been thinking about writing a book on the topic of rewrite or refactor for years now. Over the winter I finally "broke ground" on the project. Progress was initially slow, and now, given the state of things, slower than slow. Rather than wait to finish the book in entirety, I'm going to release it piecemeal and (hopefully!) publish when it's done. Feedback welcome!

Not a real book cover...yet :)

If you’re a developer at even a small organization, then most likely you work on a legacy system for at least some of your time. Maybe it’s a decades-old Java EE monolith with hundreds of thousands of lines of code, or maybe just a small IOS app built a few years ago with Objective C instead of the latest Swift.

In any case, over time that system has almost inevitably succumbed to entropy. It’s become harder to add new features, stamp out bugs, keep performance snappy, or even just apply the latest patches or updates. This can be frustrating affair for everyone, business and technology. And so you’ve probably asked the question: rewrite or refactor? Is it worth it to keep mending and enhancing the existing code base, with its all its warts and flaws, or would it be better to just rewrite it all from scratch?

Every few years I find myself at this exact crossroads. And more often than not, I consult the wisdom of my always-ready advisor: google. I plug in the search terms "rewrite or refactor", and then get bombarded with countless blog posts, forums, and articles weighing in with their two cents. Don't ever do it, some say. Or rewrite everything to microservices now! It's a complete mish-mash of advice, from the rigid and polemic to the naive and overly optimistic.

What I've always felt was missing was a balanced, technology-agnostic, pragmatic approach to navigating this challenging, crucial, and ubiquitous question: are we justified in rewriting an existing system from scratch, or we should refactor it in place, or some solution in between? And so this is the goal of this book. Having survived (and in many cases pulled off) a number of rewrites over my career, I wanted to share my perspective in hopes that it might help other developers out in the same boat. So let's get going...

Part 1: Building the case for a rewrite

  1. What do we mean by Rewrite and Refactor?
  2. The Risks of Rewrites
  3. Why we Rewrite (Even When we Shouldn't)
  4. Good Reasons to Rewrite
I'm an "old" programmer who has been blogging for almost 20 years now. In 2017, I started Highline Solutions, a consulting company that helps with software architecture and full-stack development. I have two degrees from Carnegie Mellon University, one practical (Information and Decision Systems) and one not so much (Philosophy - thesis here). Pittsburgh, PA is my home where I live with my wife and 3 energetic boys.
We're hiring! Looking for a full-stack developer (React, NodeJS or Java, AWS) open to contract work. Fully remote. The model at Highline is a little different - we're more of a co-op than a traditional consultancy. Our goal is to reward the person doing the work, and keep everything else streamlined. If you're interested, hit me up at ben@highlinesolutions.io to find out more. Send along a resume, or better yet a TechRez!
I recently released a web app called TechRez, a "better resume for tech". The idea is that instead of sending out the same-old static PDF resume that's jam packed with buzz words and spans multiple pages, you can create a TechRez, which is modern, visual, and interactive. Try it out for free!
Got a Comment?
Comments (4)
June 12, 2020
I love that your proposed O'Reilly-esque book cover contains the image shared by the existing O'Reilly book for Flash Player 11 (https://images.app.goo.gl/Q2dHv15Z3wkkfyit9)
Ben
June 15, 2020
Lol. I didn't realize that. Flash Player 11. That book was a classic! Jk.
Trey Gourley
March 15, 2022
Just came across your first three parts of this series. Any update on #4?
Ben
Hi Trey - I've had a draft for it for like a year now, but haven't gotten around to polishing it. Thanks for the nudge - I need to get back to it.
Miranda
June 13, 2022
Just stumbled onto these pages. Very interesting! Thanks for sharing your thoughts. I'd love to read more chapters.
Ben
Thanks Miranda. I definitely need to get back to it.