DEV Community

Fagner Brack
Fagner Brack

Posted on • Originally published at fagnerbrack.com on

Why You Should Forget the Tooling and Refactor Code Manually

In the world of software development, tools are everywhere. There are automated tools for testing, deployment, and refactoring. But what if I told you that relying too much on tools can be counterproductive? What if I told you that manually refactoring your code can lead to a better understanding of the system without endless documentation? In this post, we explore why you should forget the tooling and refactor code manually.

First, let’s define what we mean by “tooling.” In this context, we refer to automated tools that assist developers in refactoring code. These tools are useful for identifying code smells, finding duplicate code, and making small changes to improve code quality. However, relying too heavily on these tools can lead to a lack of understanding of the system as a whole.

When developers manually refactor code, they become more familiar with the codebase and feel the pain of change. This creates incentives to design systems that are good enough, not too tightly coupled or too loosely coupled. Manual refactoring also forces developers to move code around in small steps. Otherwise, it’s very hard to keep control of the code. This helps developers create a mental model of how the system works.

Psychological science supports this approach to learning. When we manually perform a task, we engage in deliberate practice, repeating small, specific steps to improve performance. By manually refactoring code, developers also engage in deliberate practice with their code, leading to a deeper understanding of the system.

If everyone on a team engages in this approach to refactoring, everyone will eventually have a similarly deep understanding of the system's design. This eliminates the need for endless documentation that never quite matches the code. Instead, the code itself becomes the documentation.

In conclusion, while automated refactoring tools can be helpful, developers should not rely on them too heavily. Manual refactoring leads to a deeper understanding of the system and helps to create a mental model of how the code works. Developers can improve their skills and create better code by engaging in deliberate practice.

Forget the tooling; in order to be truly productive, it's time to start manually refactoring your code.

See also Don’t copy-paste code. Type it out.

Thanks for reading. If you have feedback, contact me on Twitter, LinkedIn or Github.

Top comments (0)