Monday, August 8, 2005

Doing Things The Right Way

So yesterday I started playing around with mod_speedyfeed again.

My original goal was to add Atom 1.0 support to it, but I sort of got side tracked because it turned out I had some half finished changes in my working copy, part of an attempt to make it handle invalid XML correctly. So I hacked together a working version of that code, it was ugly, but it worked, and I could move on to actually adding Atom 1.0 support, as I originally intended.

(Well, I could move on to that except that I got tired and went to bed. Anyway.)

But all day today it sort of hung in the back of my mind, you see I had solved the problem via the first method that occurred to me, and while it worked it was kind of ugly, and I was pretty sure there was a better way to do it, I just didn't know how.

Fortunately, today was Paul's first day at work, and he's forgotten more about writing Apache modules than I'll ever know, and in about 30 seconds he was able to tell me what the correct solution to the problem was.

Tonight, I implemented Paul's solution, and not only did it do the job in fewer lines of code, it's actually more efficient than my original solution due to the way Apache bucket brigades work. That's the thing that really gets me, not only is the solution simpler, it's also better, in every way I can think of.

Man that feels good.

Of course, I still haven't finished the Atom 1.0 support. Hopefully that'll happen real soon now...

2 comments:

  1. I dont know if the quotes really a match for your case, but:
    Carters Compass: I know Im on the right track when by deleting code Im adding functionality.
    I love that.

    ReplyDelete
  2. Are you planning to cut a new release soon? :)

    ReplyDelete