Today I bid a fond farewell to templating code that I wrote several years back on a flight from Albuquerque to San Diego, and debugging while sitting on the floor of the San Diego airport (plugged into one of the few plugs I could find) while waiting for a connecting flight to San Jose. At that time, the alternatives didn't seem to be there. That story has long since changed. Over the past two years, I've converted most of the code that uses my templating engine over to Text::Template or HTML::Template. Today, the last little bit went away. Bye bye.
It was on a previous connecting flight, sitting in the same place, plugged into the same plug, that one of the benefits of unit testing whacked me on the head. I'd written a bunch of formatting translation code "at altitude". Commercial airlines are pressurized to an effective altitude of 7000-8000 feet above sea level. If you're not used to that altitude, and are already tired after a long day, it's not the best time to be slinging code. I kind of knew that, but seemed to be on a creative roll. But on plugging in at San Diego and running the unit tests, it quickly became evident that the best course would be to throw all of the new code away and start over. Without those unit tests, or with fewer tests, I'd have burned up a lot of debugging time trying to protect a dubious investment.
And for what it matters, you can roast coffee beans in a hot-air popcorn popper.