Best Before Date of Code

I was listening to the Developer on Fire podcast Episode 197  with Neal Ford today. Nearing the end of the episode around 44:00 Neal mentioned something similar to what I have been thinking about on multiple occasions:

One of the dynamics I have noticed in my career is that, inevitably, if I look back at whatever I created two years ago it looks like it’s the most horrible thing, I’m so embarrassed by it. I can’t believe I did that. […] In fact I’m a little afraid if that stops happening.

I thought of it this way: The price of improving is feeling like an idiot for what you did before. No need to be that hard on yourself, but I sometimes do feel a small sting when I look at old code I wrote.

Discussing this with a former colleague of mine he pointed out that there’s no need to feel bad about old code since it was the best you could do at the time. It wasn’t intentionally bad. If it was, you probably would not feel bad about it.

So to reverse this thinking, the code (or whatever) you produce today has it’s best before date in two years from today if you are improving. When your code from years past still looks like the code you wrote today, it’s time to start thinking what to do about it.