Refactoring

Last updated Jan 19, 2025 Published Jan 5, 2025

The content here is under the Attribution 4.0 International (CC BY 4.0) license

Refactoring is a topic that has recently garnered a lot of attention in our ongoing project. Many non-technical staff members perceive refactoring as a major project that requires significant time and resources. However, this is one side of the possible techniques available in the industry. Here the goal is to explore the different strategies to tackle the maintenance of source code.

What is Refactoring?

Refactoring is the process of restructuring existing computer code without changing its external behavior. It aims to improve the nonfunctional attributes of the software. Refactoring is crucial because it helps maintain code quality, making it easier to understand, maintain, and extend.

Why to refactor?

Refactoring shold be focused on the economics of software development, we refactor because we want to make the next thing in the software to be cheaper to implement than it is today.

Common Misconceptions

One common misconception is that refactoring is a major project that needs to be planned and executed separately. This thinking is flawed because it overlooks the continuous nature of refactoring. Treating refactoring as a separate project can lead to increased technical debt and reduced code quality over time.

Approaches to refactoring

Source code

Martin Fowler, in his seminal book “Refactoring: Improving the Design of Existing Code,” advocates for a continuous approach to refactoring. According to Fowler, refactoring should be an integral part of the development process, performed regularly and incrementally. This approach ensures that code remains clean and maintainable, preventing the accumulation of technical debt.

Sources

You also might like