|
Last July, my wife and I went on a road trip in
Norway. Upon returning the rental car, the metaphor
struck me: While all the expert advice out there shows
developers and companies how to treat their code as
they would a new car, most treat it as a rental.
How is a rental car like software code?
When the rental agent hands you the car keys (= you
get into the code), it's clean and in good working order
(= has passed QA). Together, you review a list of known
dings (= defects) and scrapes (= code smells). After a
few days, you notice rattling sounds and quirks (= code
smells) and uncleaned areas (= uncoded functionality).
You allow yourself certain things in a rental that
you'd never do in your own car. You might eat and
drink in it (= introduce code smells and leave them
there); you might drive on bad terrain and backroads
(= build unsound code, use common code improperly);
you might accidentally break a handle or knob and hope
nobody discovers that (= notice that you introduced a
serious bug, and not log it.)
There are certain things you'd never do to a rental.
You wouldn't pay to have it cleaned (= remove smells);
you wouldn't have it serviced (= refactoring and bug
fixing); you wouldn't have a body shop correct the small
dings and scrapes that happened on your shift. If the
car malfunctions (= defects), you can get it replaced
(= log bugs for much later fixing).
When I return a rental, I like to report faults and
even minor nuisances. How else would the agency know to
fix them? That's like leaving TODO comments in the code.
Notice how the above is all attitude, not
technique, due to the fact that the rental (= the
code) isn't yours. The agency protects itself from
egregious misuse, however, through penalties, fees,
and high deductibles (= you could be fired for
negligence or incompetence).
What if you owned the code? When our old car died
recently, we bought a new one (= rewrote the code),
and the attitudinal differences are striking.
I treat everything about the car gently. I take it for
scheduled maintenance. I trace rattling noises and take
care of them, or note them for the next service visit.
I've covered the cloth seats so my kids don't leave
accidental boot prints on them in winter. And they can't
eat or drink in the car.
But being this protective takes a lot of energy.
Sometimes I wish I could be easygoing about it. If
they're very hungry on the way to sports class, I might
allow them to eat in the car. That doesn't always turn
out well. Keeping code in pristine shape also takes a
lot of energy!
Code is a depreciating asset, just like cars. Rental
cars depreciate much faster than purchased ones. As
“rental” code ages, its maintenance costs rise sharply,
it can do less (if you avoid costly retrofits), and it
becomes obsolete.
A car's depreciation is your code's technical debt.
How high will you let it get? Are you treating your code
as a rental, and do you intend to continue doing so?
(P.S. I believe the rental car metaphor originated with
me. If however you've encountered it before, please let
me know so I can credit the original author.)
Copyright © 2011, 3P Vantage, Inc. All rights reserved.
|