Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

dws (341)

dws
  (email not shown publicly)
http://www.davewsmith.com/

Journal of dws (341)

Tuesday March 04, 2003
05:34 PM

Bye bye, reinvented wheel

[ #10889 ]
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.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Ahh - I still get a warm glow when I recall the replacement of a hand-rolled templating system that I evolved over several years with Template Toolkit.

    Cleaner, leaner code - and no more maintainence for the templating code. Serious warm fuzzies.
  • Ah yes, the ol' home grown templating system. I was at OSCON 2001 and Perrin Harkins gave a 'choosing a templating system' talk. As I recall the first thing he asked us was something like "Ok, hands up, how many of you have written a templating system?". I would say about 90% of the audience raised their hand - myself included.

    I seem to remember someone saying that writing a templating system was a Perl rite of passage. I can't remember who said it or where I read it though :-)