I think anyone who has worked in the software development field has probably gone through the "it must be a bug in the compiler/library" phase. The phase where your code isn't doing what it is supposed to be doing and you look at it and look at it and tweak it and tweak it, and finally you deduce, "the problem is that there's a bug in PHP" or "this is obviously DBI.pm acting up." You send an email to a list or post to a forum including your code that reproduces the bug only to learn that it is, actually, your own shoddy code. After doing this a dozen or so times, you finally reach the stage of humility where you know that there's something in your code doing something wrong. It's a growing pain. A nice lesson to learn — keep your hubris in check, take a break from the code, come back with a fresh mind, and take a clean stab at the problem before going off and declaring that there's a regex parsing bug in the perl binary.

Having learned that lesson, many moons ago, about two and a half years ago I was working on a small web app. I can't really remember what it was, but that isn't the important part of the story. I was working on a web app, and I kept getting bitten by some bug. I started believing that it was a bug in CGI.pm. But I knew better than that. Something as widely deployed and as widely used as CGI.pm isn't going to have a bug. Chances are, the bug was mine. So I took a break, smoked a cigarette, came back, and toyed with the code some more. No luck. I took another break. I came back, deleted the entire section of code, and started coding again. Same weirdness.

I started getting suspicious. I cracked open the source to CGI.pm and started digging. I know what you're thinking. This story is a harkening back to a glory day where I found a bug in CGI.pm. Well, it isn't. Well, it kinda is. Sorta. You see, the original bug I was looking for turned out to be my own shoddy coding. But I did find another bug.

Now, I had been coding Perl for the better part of 4 years at that point. I had risen from newbie to Pretty Darned Good, but I still wasn't completely sure. The offending section of code is as follows:

my(@pairs) = split("; ?",$raw_cookie);
foreach (@pairs) {
s/\s*(.*?)\s*/$1/;
.
.
.

It was in CGI::Cookie. To gain reassurance, I made the following post to PerlMonksWeird Regex in CGI::Cookie.

Everyone agreed; even the venerable Abigail agreed with me that it was a bug. Reassured by the community, I sent an email to Lincoln Stein. Yes, that Lincoln Stein, the author of many a perl module including CGI.pm. I was very humble in the email. I offered a patch. I posted the link back to the PerlMonks forum. I deferred to his guidance. But I knew that this was definitely a bug.

I was very uplifted after I sent out the email. It was my first major contribution back to Perl and to the open source community.

The email I got back, though, was not "uplifting." I couldn't find it in my email archive. I wish I could because the harshness would be better represented by direct quoting, but it went something like:

I don't know who you are. And I don't trust or accept random patches from people to code that runs in the wild with no reported problems in years and thousands of installations.

It was extraordinarily condescending. And it was quite a blow to my ego. For nearly two years, I never sent in another patch to any open source projects. I would find them from time to time. I would generate test cases that could reproduce them. I would code patches that would solve the test cases. I would get all ready to send an email with all of the appropriate material. But I wouldn't send them. I would remember Lincoln Stein.

The piece of code is still there in CGI::Cookie down there on line 56 of the source. So I guess it was never that big of a deal, but it made me never want to contribute. I eventually got over it and all. But I still remember it. I was reminded of it reading Sam Ruby's entry Cultivating a Community.

In hindsight, I understand Lincoln Stein's reservations; and they were well placed. He should have asked me for running code that ran into a problem. He should of asked me for test cases. But that's not what he did. He scared me away from contributing back to open source projects for a couple of years. Communities are important in open source endeavors. And most of the time, they are run by well-meaning, well-spoken, and nice, charasmatic individuals. If you happen to be a prominent figure in one, please strive to continue to be that way.

Trackbacks

Comments

How odd. I was working with GD.pm one day and noticed it didn't have support for all the truecolor functions that libgd had. I whipped up a patch and Lincoln accepted it very kindly.

Maybe you caught him on a bad day. It still doesn't excuse his response, but it might explain it a bit.

Posted by Cory on March 31, 2006 08:50 AM

I had a similar experience when reporting a CGI.pm bug. It's been about 5 or 6 years since then, so I don't really know if the bug is still around. But at the time, it seemed that Lincoln didn't want to accept the possibility of bugs in his code.

Posted by Scott Johnson on March 31, 2006 11:19 AM

I wonder what's worse: getting such a negative response, or getting no response at all. I'm getting tired of sending patches to open-source projects and not even getting an acknowledgement that they were received (I've never sent one to LDS). (To be fair, in most cases I do receive replies, and often the patch gets applied. But those few bad experiences leave a mark...)

Posted by Itub on March 31, 2006 11:23 AM