I have both a dog, and some code. The logic behind determining a dog’s age is something like this:
When dogs are one year old, they are really still kids, still playful and inquisitive (although somewhat unlike sullen human teenagers). They’ve matured more rapidly than 1:7 (dog-to-human years) but that changes. By 18 months, a dog has reached physical maturity. After about age 6, a dog starts to mature more rapidly than a human. Some dogs reach the ripe old age of 15 (which has been compared to a human at age 105).
But what about your code? I have to admit, sometimes I come across a program written in 2004, and I think ‘Whoa! You robust piece of code!’. Other times, my heart sinks when I see something written in 2002. Wow, that code is on its’ deathbed, it just doesn’t know it yet. It’s about to take a dirt nap.
So how DO you calculate the age of your code? If you think about your code’s birthday as the first year it is in production (after all the birthing mess, minor corrections, etc) At what point do you consider this code to be adult – more or less functioning as intended, not still hiccupy like a kid, but probably with quite a few good years left until retirement. And when is code allowed to retire, to gently ride out the golden years in a cabin by a lake?
Perhaps you don’t have a retirement system for your code – so it lurks out there, unnoticed, until one day you stumble across it and can’t believe what you are seeing. Should it be moved to a museum or something? (or a mausoleum?)
Are upgrades the code equivalent of mid-life crises? Is that when your code wakes up, realizes it can no longer go on quietly behaving, and runs out to buy a Porsche?
I have no answers, only questions. I do see that the programs written in 2002 are probably overdue for that dirt nap. I suspect that code written in 2007 is still pretty healthy, and will probably hold on for a few more years. I see code written in 2011, and I think ‘Oh, isn’t that adorable? It’s so innocent when it’s that young!’.