Saturday, August 20, 2005

Deja Vu

So I'm sitting here, reading Higher Order Perl (which is one of those books that takes a great deal of thought to get through, which is why I'm still only on chapter 5 despite the fact that I've been reading it off and on since it first came out months ago), and I can't help but be incredibly amused by section 5.4.3, which shows you how to convert a recursive function into a nonrecursive function by inlining the stack management that the programming language does for you in the recursive version.

You see, the example MJD used is iterating over a tree, and that means the code he wrote is implementing the solution to a question I was asked when I interviewed at Trilogy back in college.

The reason I'm really amused by this is that I was actually asked this question twice when I interviewed at Trilogy, once on campus where I totally nailed it, and once at the actual on site interview, where I blanked in the worst possible way and couldn't manage to come up with a reasonable answer even after the engineer conducting the interview started feeding me some really explicit hints as to how to do it.

I'm reasonably certain that it's that question and my complete and total inability to answer it that kept me from getting a job offer from them, since as far as I can tell the rest of my interviews went really well.

Of course, a few months after that interview Trilogy had massive layoffs that decimated their engineering groups, and judging from the feelings about the place I got from the people I met there, I don't think I'd really want to work there anyway, so with that in mind I'll always have a spot in my heart for that particular programming problem ;-)

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...

Sunday, August 7, 2005

Post OSCON Wrap Up

Ok, so the week was a blur, as a result I totally didn't get a chance to write about things as they were happening. Being out drinking until 2 or 3 in the morning and then going to an 8:30 AM keynote will do that to you I guess...

First off, my talk went well. Fairly good attendance, and good questions were asked. Asa Dotzler from the mozilla foundation had some particularly good points he brought up after I was done about the kind of issues they face in their world. With such a huge amount of infrastructure and applications built on top of that infrastructure it turns out that the only way they can avoid breaking things is to make sure beta releases get out there for testing, since it's almost impossible to be sure of what people are depending on and what they aren't. He's got a point, on one hand documenting which interfaces are going to change and which are not is great, but on the other you do have to be pragmatic, and pay attention to what people have actually started to depend on in the wild.

Andy Lester said that he has my book on his desk at work. That's just about the highest complement I can think of from another programmer, and I was thrilled to hear it, since someone like him (a fairly experienced programmer who already knows how to use version control software) was my exact target audience when I was writing the book.

Brian Ingerson had an interesting mini-rant right before his talk about how OSCON is getting more and more corporate, and that he's becoming more and more concerned about people supporting the grass roots type conferences, rather than just speaking at OSCON where a lot of the hackers can't even afford to get in. I'm not sure if it was really appropriate for him to get on his soap box right at OSCON, but I agree it's something to think about.

Had an interesting conversation with some of the MySQL guys about how they're using Subversion for some stuff now, and would like to be able to switch for everything, but they're running into some roadblocks due to their current use of bitkeeper and some of the features they use don't really map to Subversion very well. It wouldn't be so bad, but they can't even sit down and hack on it themselves due to the terms of te bitkeeper license. I had been under the impression until now that a commercial bitkeeper license wouldn't include the same "you can't hack on competition for bitkeeper" clause that the old free license had, but apparently it does. I continue to be shocked that people put up with this kind of restriction.

r0ml had an interesting talk, continuing his keynote from last year about the semasiology of open source. This time he concentrated on how the word "read" has evolved over the years, which was fascinating, and the questions concerning how copyright law, the concept of public performance, and open source all intermix. I won't even try to summarize, but I imagine the IT Conversations guys probably recorded it, so wait for the mp3, it'll be worth it.

Doug Cutting talked about how the Nutch project has built an implementation of the google file system and the google map/reduce system, based on the papers on both subjects. It's interesting work in distributed systems, but the thing that really struck me was how it wasn't the actual code that was the real problem (although it was nontrivial to write, of course), but now that they have it they are having trouble testing it because their cluster has a tendency to kill their DNS server and/or routers when they try to do a distributed web crawl with it.

Dick Hardt (formerly of ActiveState, now of Sxip) had a great keynote about what he calls "Identity 2.0", comparing how identity verification works in the real world and how much worse it works online. If you have a chance to hear him speak I stronly recommend taking it, he's a great public speaker and it was a hell of a lot of fun.

Brian Cantrill had a great talk on DTrace, with a fantastic demo that showed a live listing of all functions being called while running an PHP script, from the PHP level code, through the user level C code, right into the Kernel. This really seems like a hell of a reason to think about using Solaris for a development system, I mean it's light years ahead of anything else as far as being able to peek into the internals of a running system.

Was at dinner on thursday night with a bunch of people, and a few hours in the conversation crept around to Greasemonkey, and I was shocked to discover that one of the people at the table with me was actually the original author. Bill Odom, who was also there, made a fantastic point about how in the everyday world most people are lucky if once or twice in their life they randomly meet someone who's had an impact on their day to day life from afar, but at this kind of conference we get to have that experience multiple times a day. I know it's true for me, whenever I go to one of these things I run into multiple people who have made huge contributions to tools I use on a day to day basis.

Danny O'Brien killed at the keynotes on friday, talking about good and evil in the open source world. I particularly liked his comments on the famous Ghandi quote ("First they ignore you, then they laugh at you, then they fight you, then you win") and how Ruby appears to have gon from "First they ignore you" directly to "Then you win" in the space of about three weeks, largely due to the popularity of Ruby on Rails.

Anyway, I know I'm missing a lot (hell, I haven't even told any of the stories about what happened at the bars we spent so much time at!), but I think I'll cut myself off there. As I said, OSCON was a hell of a conference, and I will absolutely try to go back again next year.