I looked through some old code yesterday. It was a pretty excruciating experience. Alright, maybe excruciating is a little harsh, but honestly, I couldn’t believe what I was seeing. We’re talking pointless loops, hard coded condition statements and not just terribly inefficient SQL queries, but actual repeated queries. It was bad.
Although, aside from being a lot slower than it should have been, the script was running fine. In fact, if I remember correctly, when I wrote the thing a year ago, I was pretty excited about it. It was one of my first PHP/MySQL attempts, and it worked. That’s about all it did, but it did it nonetheless.
After I got over the pitfalls of bad programming, I came to a realization: the fact that I picked up on these inefficiencies demonstrates that I know more today than I did a year ago. This statement seems rather obvious, but it was certainly not the first thing that came to mind when I initially saw the code. Furthermore, I realized that I knew exactly what I would change if I were to rewrite the script. What once was a relatively difficult task resulting in naive spaghetti code was now a simple exercise yielding a much more polished result.
We all know that this is in fact the nature of being a programmer. We are doing something wrong if we are not constantly refactoring our code. But yesterday, it wasn’t about improving existing code, it was about seeing how far I have come.
In a lecture given at the Jamey Aebersold Summer Workshop back in 2005, saxophonist David Liebman expressed his views on the philosophy of practicing. In the lecture, Liebman suggests that self reinforcement is an integral asset to the practice ritual: “Reward yourself by listening to how you played six months ago.” Just as old code demonstrates growth as a programmer, you will actually hear definitive improvement and be motivated to practice on.
I am reminded of an app that has recently gained some traction. The app is called Timehop. The concept is pretty simple: they aggregate your social networks and remind you what you have done on this exact day in history. And their marketing pitch is pretty cliché: “Timehop helps you celebrate the best moments of the past with your friends!” But is that really the point of the app?
Aside from the elation experienced while briefly reliving that special moment in life, what’s the point? If you relive your life purely to seek enjoyment from past experiences, then what does that say about the present?
We all want our lives to have direction. It would be pretty pathetic if the best moment in our life was getting an A on a History paper five years ago. Now, that was a pretty extreme example, but hopefully you get my point. While the past can be used to remind us of isolated accomplishments, those accomplishments should be brought into a larger context. What was once a milestone should simply become part of your ongoing story that demonstrates overall growth.
We spend our lives building a time capsule. Let us not use it to get stuck in the past, but to motivate our future.