ENOTSERIOUS
29 06 2006

Thu, 29 Jun 2006

Baby steps

I spent a great deal of time last weekend, sitting in front of my computer at home and slogging through some Lisp code. I had multiple windows up on the screen: the Common Lisp Hyperspec, Peter Seibel's Practical Common Lisp, the SBCL online manual, the SLIME manual, and an emacs instance. I pinballed back and forth, trying to learn and use the tools at my disposal, hoping to emerge with something useful to show for it all.

A useful toy application? At work I get bombarded by spam all the time, and I employ both SpamAssassin and Bogofilter against it. But I'd also like to filter my inbox against a few RBLs that I like. Unfortunately, I have no control over the MTA at use in the office, so if I want to employ an RBL I have to do it by looking at Received: headers in mail that has already been processed by the MTA. So my assignment was to parse Received: headers from stdin, and run those IP addresses through a list of RBLs.

Some 9 or 10 hours later, I have 29 lines of code to show for it. TWENTY-NINE. That's one LOC for every 20 minutes I've spent so far.

That's humbling, that's what it is.

Yet every 20 minutes I grow stronger. My fingers learn new emacs key bindings. I inspect stacks of broken code, generated by misused macros, and puzzle out how I got there. The differences between eql, equal and equalp get hammered home.

My toy does some piddly file I/O, some condition handling, some string and vector manipulation. I even memoized a function -- ooh look, a closure!

29 lines. They take up less than a screenload, and they don't do anything very sophisticated. Yet I'm as proud of them as I've been of any programming effort I've undertaken in a very long time.

posted at: 20:05 | path: /dailies | permanent link to this entry