The joy of revisiting old code

What happens to you when you look at old code of yours? When I say old, I do not mean code you wrote last week. I am talking about code you wrote a while ago, code that belongs to a project you worked on and might currently be in production for example. That kind of code! Let’s talk about such a case, let’s talk about the moment you go back to that piece of code to either fix a bug or see how you solved a problem you are facing in your current project.

So… back to my question… how do you feel about it?

a) Are you absolutely proud of your code?

b) Are you quite happy about it but you feel you could change one thing or two?

c) You feel like refactoring?

I have to admit that I frequently do pick c). There are very often quite a few things I don’t like, parts I feel I could have written differently. And realizing this puts a big smile on my face!

Assuming that you always write high-quality code according to your current skills since you are always doing your best, the fact that you don’t like your own old code simply proves that you are at least a slightly better developer than a while ago, it means that you have done some progress.

So, if this happens to you from time to time, this should definitely put a smile on your face too!

But wait! This smile should not last for too long… Why? Because you realize that this was not the first time you experienced this and is hopefully not going to be the last one either.

The moments when you realize you are better than earlier but you still know that there is an improved version of yourself waiting in the near future is what keeps you going, what pushes you to keep learning.

Next time you feel that you might need some extra motivation, consider having a look at some old code of yours to get back on track ;-)