Why you should consider refactoring
We just saw that refactoring is highly coupled with the concept of clean code. Hence, we could say that one of the most important outtakes of refactoring your code is to improve its readability. In other words, refactoring makes your code easier to understand.
Even if the main goal of writing code is to tell a machine to do what you want, exactly the way you want it, it’s important to underline something that we tend to forget, sometimes: you have to be understood not only by computers, but first and foremost you have to be understood by human beings. And one of those human beings is you: your future self! In my experience, I’ve found myself a lot of times asking, “Why?!” looking at a piece of code I wrote, maybe just weeks before.
Although it may seem simple or even naive, the idea of writing readable code is often overlooked due to the urgency of making our programs work. While this is certainly important, we must...