This is your goal. So to say, from the engineering perspective. You want to reach a certain architecture. You want to have a certain way of composing your components. You want to have a way of consuming a design system, let's say.
So you have here all your patterns and your architecture. You can draw your diagrams, you document how the engineering team works, how they think like very high-level about where they want the codebase to go. But you also then drill down, you get lower and lower in terms of abstraction.
So you can have in your practices, how do you normally structure code? Do you create folders for each component? Do you split files by function? Do you split files by feature? How do you just structure your code in general? And even lower at the code level, you can have your coding guidelines. And I'm not necessarily thinking here about things that can be automated, but just patterns that you and your team figure out, hey, there are three ways, and just as Nick showed, there are three ways of doing something. Especially with React. Let's pick one. Let's have our way of working documented. We use Code Sandbox, these kind of general coding guidelines that we have internally and we reference in all the PRs.
So whenever there's a discussion in a PR, like should you compose components like this or like that? Oh, yeah, actually, there is a guideline for that. If there isn't a guideline for that, now is a good time to just, you know, add it there. So these are practices, right? This is the... Like this is kind of giving you the North Star of what you want to achieve with your refactoring process. And now we move on to inventory, which may be the most important one and may be the most overlooked.
And in my past experiences with different teams, I noticed that a lot of people treat this rather superficially. So inventory is about gathering all the facts. What happens in the codebase? Now how far are we from the desired result, right? So this is about logging things, let's say, in the backlog. That's one thing that probably is the most common thing whenever people have a technical that they know they want to refactor. They'll probably create a ticket.
What we noticed with backlog tickets at code sandbox is that they tend to just rot there in the backlog because no one checks them out. So we started a new thing called the technical debt accounting, which is a separate document that we reference, again, in PRs. Whenever a PR, let's say, introduces a technical debt because of different reasons, like no lack of time or we just simply don't yet have the abstraction for something, we say, OK, let's put this in the technical debt accounting document. Let's explain it there. Why did we introduce the technical debt? What's a possible solution for it? Who owns it? Who is not necessarily who will solve it, but rather who will raise the flag that, hey, you know, this is important and we haven't solved it yet? And then, finally, we assign a priority to it. And this is also part of the inventory process.
Comments