WTF?

I’m busy re-writing vast swaths of my low-level code in order to support a new database schema. One of the classes that I wrote that got used all over the place is called “Playlist”, and its various subclasses. Playlist has an abstract clone() method. I almost never write clone() methods, so somebody must have asked for it. And I think I know who now.

As part of this re-write, I using Eclipse’s “Find References” function a lot to see if some method needs to be re-written or can just be deleted. While doing that, I found an interesting bit of code in an obscure part of the system that I’ve never looked at before:


private Playlist doClonePlaylist(Playlist playlist) {
Playlist clonePlaylist = null;
 
// need a special clone
// as the playlist cone function
// doesn't copy the playlist
// external id which we really need
if (playlist != null) {
clonePlaylist = (Playlist)playlist.clone();
clonePlaylist.setExternalID(playlist.getExternalID());
}
 
return clonePlaylist;
}

If the guy who’d written this bit of cruft still worked here, I’d want to ask him why the fuck he didn’t just tell me that I’d left one parameter out of my clone() method, or even better, fix it himself? Ideally, I’d want to ask him while dangling him over the edge of a multistory building, but that isn’t going to happen.

Speaking of planes whose engines quit

I was just reading the story of British Airways Flight 9 on Wikipedia. I hope that some day when I get into difficulty as a pilot, I’m as calm as Captain Moody:

Ladies and Gentlemen, this is your Captain speaking. We have a small problem. All four engines have stopped. We are doing our damnedest to get them going again. I trust you are not in too much distress.

That’s just beat out Captain Al Haynes “You want to be particular and make it a runway, huh?” as my favourite aviation quote.

Well, that was fun

I was driving to work this morning, admiring that unfamiliar shiny yellow orb in the sky and thinking that if I wasn’t overburdened by work and it wasn’t windy as hell, this would be a good day to go out flying. But then I saw a pickup truck with a ladder in the back backing down the shoulder. “Why would he be doing that?” I wondered to myself, when suddenly the van in front of me ran over another ladder that was lying the road, causing it to pop up into the air menacingly. I swerved around it without hitting either it or any surrounding cars, and afterwards had time to wonder if it would have hit my grill or come in through the windshield if I’d hit it.

That’s me in spades

I just finished reading How To Recognize A Good Programmer, and kept thinking “hey, that’s me” for every point. So why did my last two job interviews not go so well? I’m a good programmer, I know I’m damn good actually, and according to this, everybody else should think I am too.

Oh well, I’ve got 6 months left on this contract. Maybe I should get some paper qualifications to impress the people who aren’t smart enough to read that article.