“refactor refactor refactor your code.” What does this mean exactly and why do it

refactoring

I often heard from professionals blog something like refactoring your code whenever the chance you get. What is it exactly? Rewriting your code in simpler and fewer lines? What is the purpose of doing this?

Best Answer

Refactoring code is a process of cleaning up your code, reducing the clutter and improving the readability without causing any side effects or changes to features.

Basically, you refactor by applying a series of code change rules that improve code readability and re-usability, without affecting the logic.

Always unit test before and after refactoring to ensure your logic isn't affected.

Related Topic