Programming and Ego

In my experience, most good programmers, and some not so good programmers, have an ego about it. I certainly do. Sometimes my ego writes checks that my ability can’t cash, but normally it doesn’t cause problems. Much.

The biggest problem is that when people say there are problems in my code, my immediate reaction is disbelief, annoyance or anger. I know there are bits of the code, especially the bits I inherited from others, but also some of my own, that are bug ridden and questionable, and I don’t react that way to those. But there are other areas I’m proud of, sometimes justifiably. And when somebody says something is wrong with those, I flare up internally. I try to catch that before I express it, and sometimes I succeed. Sure, QA sometimes reports a bug because they tested something wrong. But they have a job to do, and they do find stuff that I missed distressingly often.

The worst problem is when my ego clashes with that of another programmer. Right now I’m in a bit of an ego battle with another programmer. He says that a certain method in my database code that he’s supposed to call every night is returning the wrong values. I say that’s impossible because that method was tested last year, and it hasn’t changed in two years. (It’s dead simple, too, just a select * from playables where end_effective >= ?) He says “here are some log files that show your method returning the wrong values every day until the 28th”. I say “wait a second, those log files show that you didn’t even call my method until the 28th!” He says that’s because he turned on full debugging on the 28th. And that’s where it sits. Tomorrow we have the show down. The QA person has set up a test case, and tomorrow we all meet in the lab to examine the log files and database together.

It should be fun. Unless it turns out the problem is in my code, in which case I’ll have to go into a 2 week sulk. Anybody taking bets?

Upgrade nearly painless

The WordPress SpamKarma plugin was complaining about invalid SQL syntax. A little investigation showed that SpamKarma was expecting MySQL 4.0 or newer, but reluctantly allowed you to use MySQL 3.x as long as you accepted there might be some problems. I’d had other problems with the old versions of software that were part of Fedora Core 3.

I decided it was time to upgrade to Fedora Core 4. I don’t know for sure, but I think I’ve been on FC3 for a couple of years now. I would rather upgrade to Debian Sarge, since this machine is really just a server now, and I hardly ever use X Windows on it. But that would require too much work. It appeared I could upgrade from FC3 to FC4 using yum, with minimum downtime, so I set aside some time today to do it.

The upgrade is now finished. It was surprisingly smoothly, except for one thing. Inn won’t run. I can’t even rebuild the history files with makehistory – it dies with a SEGV. I’ve tried all sorts of things, and I’ve tried writing to Russ, the main developer. I have a bad feeling that I’m going to have to switch to installing from source, and I don’t want to lose the advantages that you get when you let somebody else (in this case, the Fedora team) manage the upgrades and dependencies.

A couple of geeky items

1. I’ve been playing around with SQLite on my linode. The database generation script runs twice as fast as when I use MySQL. But I’m having one major problem with the update script – it’s probably due to the Perl DBD::SQLite, rather than SQLite itself, but if I insert into a VARCHAR column using


my $wptInsertStmt = $conn->prepare(qq{
INSERT INTO wp_test
(id, datasource_key, tpa)
VALUES (?, ?, ?)});

$wptInsertStmt->execute('abc', '111', 555);
$wptInsertStmt->execute('1E2', '222', 123);

the ids that look like numbers get interpreted as numbers, so that ‘1E2’ gets inserted as ‘100’. Both MySQL and PostgreSQL versions of this code get it right. I suspect I’m going to have to convert the code to use bind_params, which will bloat the code and lead to problems if I get it wrong. It also appears I have to close all my prepared statements.

2. I hereby officially declare THE DEATH OF THE FLOPPY. I was using a floppy to transfer files between my development machine and my test machine. But the shutter on the floppy I was using suddenly stopped working. So I got another floppy, and after a transfer or two, I started getting I/O errors on the new floppy. So I grabbed another, and the same thing happened. That’s when I realized that when the spring sprung, it probably fell off inside one of my floppy drives and is still wreaking havoc on every floppy I used since. Unfortunately I couldn’t find my USB drive, so I had to beg one from a cow orker. Even if it is at home, I’m thinking of buying one or more new ones. They’re certainly cheap enough.

3. The LUGOR mailing list today is full of the plaintive crys for help from a guy who seems to be doing web design for a guy who doesn’t seem to have gotten the idea that a corporate web site should be about content, not craptactular toys. The first request was for information on how to put an animated train running around the borders of the web page. Evidently the boss is a dentist who has toy trains running around the office, and he thinks this would transfer well to his web site. The other, equally brain dead request was for putting automatically translated versions (ie Systrans or Babelfish, not human translated) of all of his web site up and automatically directing people from those countries to the “translated’ version. Can you imagine what a great image you’d give to people in non-English speaking countries subjecting them to Babelfish versions? Especially since you’d be automatically redirecting them there, even if they spoke English. I told him to look at Engrish.com and imagine people all over the world submitting his site to the local equivalent of that site.

Nice flight

It was a surprisingly nice day. Actually, I hadn’t noticed it was going to be a nice day until I was reading Information Echo, where he was opining how he was going to miss the flying day due to family commitments. I quickly hit F12 to bring up the Dashboard, where the Aviation Weather widget showed me that the only clouds forecast were high cirrus. Ok, not exactly sunny, but extremely good VFR throughout the region.
Continue reading “Nice flight”

Today’s interesting discovery

I’ve just discovered  lighttpd, a small memory footprint web server that supports all the stuff I currently use on my Linode – it’s got server side includes, fast cgi, simple virtual hosting, and mod_rewrite type redirection.  And Ruby on Rails supports it.  Ruby on Rails also supports SQLite, a small memory footprint SQL RDBMS.

Considering the small memory on my linode, I’m thinking that a transition from Apache and MySQL to lighttpd and SQLite might be just the ticket to improve the performance.  Which will be important if I start playing around with Ruby on Rails, because these “do everything including the kitchen sink” things tend to be memory and CPU hogs.

Now I’m trying to figure out how to test a transition.  I could install both of them on my home server and run it on another port.  I could install both of them on my linode and run it on another port.  Both of those options have the problem that it’s not a 100% accurate test, because I’d have to change the code to support a different port, and then change it back if/when I make it the true thing.  Another possibility is to buy another Linode for a few months and try it out there.