labia

Monday 11 August 2003

I keep completing things that I've been meaning to do for ages and then realising they weren't on my to-do list. That's my excuse for why my to-do list never gets any shorter, anyhow.

I got another mail from Jonathan Swartz asking about the use of Class::Delegation with CGI::Wiki - apparently Class::Delegation doesn't play too nicely with mod_perl. I'd been meaning for ages to get rid of this dependency, and Jon's mail reminded me to get around to it.

I was very pleased when Richard first pointed me at Class::Delegation, because it seemed a very nice way to avoid having to write

  sub method1 {
      my $self = shift;
      $self->attribute1->method1( @_ );
  }

  sub method2 {
      my $self = shift;
      $self->attribute2->method2( @_ );
  }

etc etc. (I'm not allowed to do that sort of thing in AUTOLOAD because it makes Richard turn funny colours.)

It started getting on my nerves reasonably quickly though, because it eats your attributes' methods' error messages and replaces them with "Could not delegate <method>". This is not very useful. No, I never found time to look into it and find out if I could stop it doing that. Bad programmer.

While I was taking it out, I found some slightly dodgy assumptions in some parts of the code that had previously been obscured by Class::Delegation papering over cracks. Lessons here:

1) Tests are wonderful. Tests are really wonderful. The CGI::Wiki tests are well worth the (maybe slightly excessive) length of time they take to run.

2) Sometimes nice syntactic sugar can make what's really going on less clear.

We'd lost the OpenGuides London mailing list archives when my drive died a while back. Yes, I still had the data. I just ran mariachi on an mbox and now the archives are back and shinier than before.

< Monday 12 August 2003 Thursday 7 August 2003 >

foo

HTML generated from pod with podblog