The Importance of code refactoring.

The Importance of code refactoring.

How refactoring can make it easier for other developers to contribute on your/a open source project

Recently I have been refactoring some of my old projects along with my friend who is also a developer, and I just realized as I was busy, that most beginner developers are hardly ever told or taught about refactoring code. Some do even know what it is.

Hopefully this article can help someone out, and begin their research of the importance of refactoring code.

What is code refactoring

Code refactoring is retrieving existing code and restructuring it, or cleaning it up without changing the core functionality of the code/application. This process enables others(developers) to be able to read your code much quicker and make necessary improvements to the features or functionality of the application.

My experience with refactoring

The QR code inventory tracker ASP.NET web app is one my recent projects which I have been refactoring, because someone simply told me my code looks a bit ugly, which I took as constructive criticism. These are the three steps which I took to begin my refactoring process:

1. Check variable names This always the issue with most beginner developers, but there are times where I tend to be guilty of this as well, my variables were not descriptive enough for a few people to see what I was actually implementing in various sections of my code.

2. Structure of the Logic
The long keyword not being familiar to a lot of developers(C# specifically) added to the confusion of what I was implementing. The name variables is what helped them interoperate the Random() number generator

3.Comments This is a really big one. I did place in the code, the only issue was it not being in plain English. Comments do enable developers to focus more on enhancing functionally of the app/web app, also when it comes to fixing minor/major bugs, that can also be done quicker due to comments being placed.

Conclusion

Please try to make sure your code is clean, if your unsure there are people who are more advanced who are willing to help. Cleaning your code will also make you a person that other developers will to work with.