Every now and then, when I have time to spare, I take out my laptop and read some of the code I'd written in the past. This includes projects I did during my Bachelors degree, some code snippets of projects I did for my Masters course, and some others, from previous employment. (Of course, I don't have entire projects from previous companies - just a few files that I'd worked on from my home computer. So, don't ask!) Every time I read the code, I cringe. I can't believe I'd written code which was that bad! I see new bugs, violations of coding practices, poor design, and even misuse of language constructs. And I know for a fact that when I was writing all of that code, I not only thought I knew what I was doing, I knew that I knew what I was doing. (Wow - too many I's in this paragraph.) For some time now, this has bothered me, because I have the same feeling of knowing what I'm doing as I write code today. Why would I be correct now? Maybe, in some later year, I or someone else would look at my code and realize how bad it is (was)? Does this happen to others? Have you ever read code you'd written earlier and cringed? If so, use the comments link to send your experience.
I'd earlier mentioned a paper I'd submitted (with some colleagues) that was nominated for the best paper award at FSE 2009. We didn't win, but here is a copy:
http://research.microsoft.com/en-us/groups/adp/debugadvisorfse09.pdf.
Enjoy.