Just now I’ve finished refactoring one of my clients projects. Refactoring your own code can be tedious from time to time but it’s important. But why is that? Most of the time refactoring your own code does not help you become a better programmer. It does not help you earn money since most of the time you won’t be able to charge for any of it.
I argue it helps raising your reputation - in two ways.
-
Your clients will be more pleased. Whenever I start refactoring my code I have to go through it over and over again. And I’m not just talking about syntacic sugar here, I’m talking about adding new libraries, re-writing parts of your code in its entirety. It’s like I’m re-creating everything, but with more informations than I had before. This enables me to reduce code complexity, helps me remove bugs I didn’t even know I had when I first wrote this code or add the finishing touch to features I considered done. It help’s me increase the overall stability of my code. Increased stability also means less crashes, and more solid features mean less annoyed clients.
-
Your successors won’t think bad about you. When you create something new from scratch chances are you won’t be working on it forever. Meaning others will have to clean up the mess you left behind. Leaving behind less of mess also means that your successor will be able to work with your code more easily, and hands down reduce the chances of them bad mouthing your work. Maybe he might even start looking for more of your work on github - who knows?
Although I have not always thought like this you have to start somewhere - somewhen. Why not now?