Let's throw away everything and start fresh. Sounds great, right? While this can feel very good it rarely speeds up anything. I'll show you why a complete rewrite is usually not what you want.
![React Summit Remote Edition 2021](https://gitnation.imgix.net/stichting-frontend-amsterdam/image/upload/v1619376965/gu6c5rsayr3qtz6zvshf.jpg?auto=format,compress&fit=scale&w=60)
Let's throw away everything and start fresh. Sounds great, right? While this can feel very good it rarely speeds up anything. I'll show you why a complete rewrite is usually not what you want.
The Talk discusses the 'rewrite trap' in software development, where the urge to start from scratch often leads to poor outcomes. It emphasizes the importance of understanding the existing project before making big technical decisions and the benefits of gradual improvement. The Talk also highlights the challenges and pitfalls of a complete rewrite, such as false sense of productivity, problems with edge cases, and the accumulation of tech debt. It stresses the need to understand the system and its influences, cater to the needs of stakeholders outside of engineering, and focus on creating value.
Hello, everyone. My name's Phil. I'm a software engineer at Brighter. Today I'd like to talk to you about a thing I call the rewrite trap. The urge to start from scratch often comes from not wanting to learn new concepts, not aligning with the existing architecture, and the desire to work in a way that aligns with personal preferences. However, these reasons rarely pay off in the long run. It's important to take the time to understand the existing project before making any big technical decisions. The trap lies in the belief that a complete rewrite will lead to better outcomes, when in reality, gradual improvement is often a more effective approach.
Hello, everyone. My name's Phil. I'm a software engineer at Brighter. I've been a tech lead before and also a CTO, even though I got fired from that job, more on that later.
And today I'd like to talk to you about a thing I call the rewrite trap. And first, before we start, let me set the stage. So what kind of rewrite are we talking about? It's definitely not the one where you know the project for months or years. You're super familiar with all the ins and outs, the tech, the architectural decisions, all of that, and you're absolutely sure what you need to do in order to get this, you know, off the ground, right? Maybe even there is a new project, right? And you actively make the decision to not stick with the current stack or the legacy platform or whatever, but start from scratch, right? This is not what this talk is going to be about, right? Because I think the read-write or the starting from scratch might be the best option. I'm talking about the situations where you, you know, might be the new tech lead in town, right? Or the new CTO in town. You join a company that has an existing product. There is a stack, there is software there. And you kind of have that feeling that after, you know, looking at it for, I don't know, one or two days, you just think that it's better off, you know, throwing away everything and starting over, right? This is what this talk is going to be about, right?
So, let's start with where does that urge come from? And I think there are three main reasons. The first one is you don't need to learn new concepts, right? So, let's for instance say it's a client application, it's written in React, but you, you know, you like Vue or you like Svelte or whatever better, right? And getting into React, you immediately have that repulsive feeling that you really don't want to get into this, right? So, if you throw it away and rewrite it in your stack of choice, then, you know, that would make that problem go away. It's the same for, you know, programming languages, methodologies, whatever, right? So, everything that you're not used to you kind of immediately say maybe let's not do that. The second thing also is someone else built that, right? So, if you really like a certain architecture, let's say for instance you really dig functional programming, but the current product is built in a very object oriented fashion, then, ha, you know, those two worlds might not align so well, right? And, it always, you know, would feel like, you know, a hurdle to get acquainted with everything, right? And, you might already notice there's a pattern here. And, the pattern is not that necessarily, you know, tech choices, programming languages choices, architecture choices are better or worse. It's just that they're different and that, you know, intrinsically, if something is different to what we prefer, we, you know, have to fight that urge to just, you know, throw it away and, you know, turn it into something that we like. And a colleague of mine once gave me the advice to wait 100 days until you make any bigger technical decisions once you join a new job, right? Because, in 100 days, you can learn a lot and also, you can figure out whether something, you know, you know, a choice from the past is actually worse than what you wanted to, you know, wanted to use. Like, is it, you know, a problem that it's object oriented? Should it be functional? Or whether this was just, you know, your initial gut reaction to a certain thing and you just didn't like it, you know, before, but probably 100 days in, you also got used to it and then maybe it's not that bad anymore. Personally, I have to admit, I always, shortened that period to 50 days. Because especially when I was CTO, I couldn't convince my CEO to just wait, you know, almost a third of a year before I started making bigger choices. Let's just start up life and you gotta, you know, do what makes sense at the time.
Now let's get to the third part. And that's the biggest egomaniac part of it, right? If you just throw away everything, you can essentially work the way you want, right? You make up all the rules. So this definitely feel comfortable, right? The big question to ask here is just, you know, will that, you know, is that, is that something that makes sense in the long run, right? Is your way of working, for instance, compatible with how the company works? Right. And yeah, you know, all of these things that I just outlined, kind of feel initially, maybe like good reasons to start from scratch, right. And we can definitely talk ourselves into, you know, assume benefits of either one of these. But the question is, do they really pay off? And I think they rarely do. And this is also where the trap comes in because initially, if we look at these projects, so I've drawn two made up lines, essentially, you know, the green line representing a, you know, existing software project and you don't rewrite it, but you try to gradually improve it, you know, work your way through the project and you know, make it better. And the purple line represents the complete rewrite and the X's are just time on the X axis and the Y axis is outcome.
If you start a rewrite, nothing's there, nothing's holding you back. You can push out a lot of stuff in the beginning really fast. The people who stick with the existing code and try to gradually make it better first have to go through the weeds, learn the architectural choices, and gradually improve the running system. That false sense of productivity in the beginning leads people to making those rewrite choices.
Like how much can you actually achieve? And obviously if you start a rewrite, nothing's there, nothing's holding you back. You can push out a lot of stuff in the beginning really fast. So you could even then fool yourself into thinking, wow, this must have been the better choice. We're so fast. Everything's moving fast. That's great, right? Well, you know, the people who would stick with the existing code and try to gradually make it better first, you have to go through the weeds, learn the architectural choices, you know, see what's there and gradually improve the running system, essentially. And this is where the trap comes in, really, you know, that false sense of productivity in the beginning, is what I think leads people to making those rewrite choices. And I give you a hint, maybe it's also good for your career to do this, right? Because like, I don't know how long, you know, the phases of one, two, and three are. But if you leave in phase one, or at the end of phase one, all you've done so far seems very productive. You've done a great job. So you might be the, you know, the really good tech lead that just gets things done and that just does the things no one else wanted to do. And it helps you progress, you know, maybe do that if it's good for you, but I am not that person.
We constantly think of articles and videos that might spark Git people interest / skill us up or help building a stellar career
Comments