Good Refactoring vs. Bad Refactoring 09/03/2024 Good Refactoring vs. Bad Refactoring https://www.builder.io/blog/good-vs-bad-refactoring The problem is that bad refactoring is bad. One of the most common mistakes I've seen is when developers completely change the coding style during a refactor. I once hired someone who added tons of new abstractions without understanding the underlying code. One of the biggest problems I've seen is refactoring code while learning it, in order to learn it. It's worth noting that you do need to refactor code. But do it right. Our code is not perfect, our code needs cleanup, but keep consistent with the codebase, be familiar with the code, be choosy about abstractions. Deeply understand code before doing significant refactors or new abstractions. Avoid too many new abstractions: Keep it simple unless complexity is truly warranted. Write tests before and after refactoring. This ensures you're maintaining the original functionality. Refactoring process