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.

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.

0wnzord

Vicki asked me to stay home this morning because the furnace guy was coming to do one of the inspections on the hideously expensive maintenance contract we signed up for due to a hard sell sales pitch. She wanted me to stay because she says the furnace guy gives her a real hard sell every time for something that we absolutely must replace or we’re killing babies and torturing puppies. I’m not sure where she’s been for the last 11 years, but by now you’d think she’d realize that I’m no better at resisting those sorts of sales pitches either. But hey, this spreads the blame around for the stupid stuff we get talked into and takes the pressure off her, so I’m willing to do it for her sake.

The guy came, did the usual poking around in the basement, and came up and said “Your ignitor unit is testing at 99 ohms and we recommend replacing it any time it gets to 100 ohms, so you’re due”. I asked for a price, and he showed me it woud be $160 now, or $280 if it was an off-hours call. So I thought I’d outsmart him and ask if he had one in stock, and he said no, he’d checked the truck and he didn’t have one. I figured that would mean that if it *did* fail in middle of the night, we’d have to wait for a day or more while they ordered the part, and we’d risk the birds dying if that happened, so I said to go ahead and order it. A few minutes later, as he’s leaving, I asked when they were coming to install the part, and he said “I had another look around the truck, and found one, so it’s installed already”.

Dammit, he played me for a chump. He must have known that if he’d said they had one in the truck that I would figure they’re easy to come by and so I could afford to wait until it failed, but if they didn’t I’d want to replace it pre-emptively. I’m such a sucker.

Ouch

My back spasmed up in the middle of the night. Actually, it was about 5:30am so I just got up. But because I’m working on my Functional Spec, instead of spending the day lying down to relieve the pain, I’m going from chair to chair trying to find a comfortable position to type.