Untraditional Refactoring Technique
September 30, 2005
Bizzarely, today I found myself deleting a test script preparing to refactor the code it tested. Really.
Before you proceed to tear your hair out, let me just say that it’s not actually as crazy as it sounds, however. The project in question is a forked and cut-down version of a project with much wider scope. Therefore it has lots of code in it that is not exercised by the consumers of the API it provides, but only of its own tests.
The particular test I deleted was checking to see whether all the Perl modules in the project actually compiles. By removing it we can simply prune modules that are not even loaded off disk. The test coverage report I’m going is produced by running the project’s unit-tests as well as running all the other individual projects against it. Our build system checks all of these out of subversion for the builds, hence I could not simply omit to run the offending test.
OK, so this is not really a refactoring, but simply a way of deleting dead code. Refactoring is a much hotter buzzword though, so I wanted to squeeze it into the title of this post somehow. Once the effort of removing the dead code is over I’ll add the test back in.
Lamb shanks
September 29, 2005
Today I had lamb shanks for lunch at the pub. It was lovely. Just as well then that I had lamb shanks in a plum tomato & red wine sauce for dinner. It was great too.
IE handling of CSS
September 29, 2005
It pisses me off. I’ve just found out that it screws up on the new and shiny theme for my blog (it puts the content of the sidebar to the left at the bottom). It must die.
Powered by WordPress
September 28, 2005
I finally got around to ditch the homebrew blogging software I’ve been using. I started writing one to “see if I could”, you know, the classic story. Unfortunately it got boring rather quickly and the thing got less attention than it needed. So, I was left with a half-assed solution. Not so anymore! My blog is now powered by WordPress, which has a lot of nice features, including making drafts and the ability to leave comments.
I’ve not played around with it for more than a week or so, but it seems pretty decent so far (despite being written in PHP). If nothing else, it’s introduced me to mod_rewrite, which is tremendously cool. Though I’ve known of it for a goood while, I’ve not actually used it before. It has also prompted me to take a closer look at Markdown as well. It seems very, very promising, and I suspect I’ll grow to like it very much.
At the moment this site is a unsightly mess of WordPress-powered blog and HTML::Mason for the rest. I’m planning to fix this, but I’ll have to take some time to figure out how to best fix it. Also, I doubt that the permlinks for old posts at the moment. This will also be fixed, as soon as I figure out how to make mod_rewrite transform argument names…
Pulling teeth
September 16, 2005
So, I’ve been working from home today because I had a dentist appointment to have the last of my wisdom teeth extracted and a filling replaced. Dentists and I get on like a house on fire, so this promised to be a smashing day.
It started well. The three stabs with a syringe were less painful than I remembered, and by the time the third one went in the first two had started working so I could not actually feel it. From there it went downhill, however.
It was a slightly complex extraction, my dentist cleverly waited until afterwards to admit, so to avoid risk of nerve damage he had found it necessary to break the tooth into three pieces. First he simply broke off the top by application of a metal object and brute force. Then he started to drill a line across the remaining stump, deeper and deeper until it broke into two halves and he could extract each of the roots separately. This process went on for a while, but I won’t bore you with the details.
When all the bits were finally out he wiped sweat off his forehead and muttered something to himself along the lines of “huh. not as bad as I’d thought”. I didn’t ask, but just sighed in relief. He had the impression that this went better than the last time he confiscated any of my teeth. I think he had me mixed up with someone else.
Changing the dodgy filling was quick and painless, but afterwards came one thing I was not expecting: I had to have stiches. In my mouth. This too turned out to be quick and painless, however.
I was now almost done, but–as I had known all along–the most painful part had yet to come: parting with money.
[...]
Fast forward to the pharmacy counter at Sainsbury’s. I mumbled a request for the brand of painkillers recommended by my dentist, and the chap behind the counter immediately asked, and I shit you not: “How many packets do you want?”
I’m now going to wallow in self-pity for a while. In the meantime, you can enjoy these pictures: mouth and tooth.
A Midsummer Night’s Dream
September 13, 2005
Yesterday a Shakespeare classic arrived at our doorstep, courtesy of Amazon DVD rentals. Not having seen a stage adaption, nor having read the manuscript, I had the benefit of watching it with an open mind.
I must admit to having a bit of problems following the dialogue (or, rather, the succession of monologues that seemed to pass for dialogue) at first, but it turned easier after a while. It turned out to be a lot merrier than I’d imagined. Unsurprisingly (for the classic meaning of comedy) it had a happy ending, which I’m always a sucker for.
I really liked Rupert Everett as Oberon. Stanley Tucci as Robin Goodfellow was also great. I’m not normally a fan of Calista Flockhart, but she did a pretty good job here, playing Helena. Kevin Kline as Nick Bottom was really cringeworthy, which I guess that was part of the point.
All in all, good fun.