Horizontal Reuse: An Alternative to Inheritance

In class-based object-oriented programming, when there are classes that appear to share some functionality, this is often a time when people will refactor them into two subclasses of a common base class, avoiding repetition.

For example, in my farm model the Horse class and the Tractor class each implement a pull_plough method. (American readers might prefer pull_plow.) So this method is a candidate to split out into a Hitchable class for Horse and Tractor to each inherit from.

This would have nice benefits for polymorphism. I’ll be able to pass an object to my Farmer which will only need to check that the object inherits from Hitchable rather than having a hard-coded list of classes like Horse and Tractor that it knows are acceptable.

Perils of Plugins

Plugin-based architectures can be a bad idea. Not always. In user-facing applications, where the list of installed and enabled plugins is clear, then plugins are often a good thing. This article is concerned not with end-user facing applications, but with libraries. Libraries that allow their functionality to be extended through plugins. In particular, libraries that … Continued

10 Out Of 10

How to File a Perfect Bug Report My criteria for a perfect bug report… The report is filed correctly. The issue identified affects the latest version of the software. The report includes a test script illustrating the problem … which is self-contained … and is minimal … and conforms to the Test Anything Protocol. The … Continued

Be Your Own Big Brother

Many modern browsers (including recent versions of Firefox and Opera) support the W3C’s geolocation API. This is a standardised mechanism for Javascript to ask your browser where it geographically is in the world. Typically the browser will then pop up a message asking you if you wish to reveal this information, giving you the opportunity … Continued

Meteor Shower!

So the cat was meowing outside the bedroom door this morning, so I got up to let him in. He loves to sit on the window sill and look out at the birds on the roofs of the houses across the street, but the sill is so high that he can’t easily jump up there. … Continued

The Mother of All Demos

It was 40 years ago today that Douglas Engelbart gave a demonstration that introduced the public to an impressive list of technologies which would in the following years become established in the mainstream. On the 9th of December, 1968, he demonstrated: a mouse; hypertext (i.e. text with links that can be followed — a precursor … Continued

A Case for the Inspector…

In the news today: robbers dressed in drag steal €80 million worth of jewelry from a shop in Paris. As covered by: The Times Reuters etc… Also in the news today is that it's the 50th anniversary of two firsts The first STD call in the UK, dialled by the Queen; and The opening of … Continued

Wallander

I meant to post this article a couple of weeks ago, but I’ve been very bad at updating my blog recently. The BBC is showing an adaptation of one of Henning Mankell’s Wallander novels tonight. Mankell is one of my favourite crime fiction writers, so here are a few random thoughts (no spoilers!): They’ve started … Continued

54 Percent

BBC News has an article claiming that: The new projections suggestion that by 2050, minorities will account for 54% of the [US] population. Ummm… wouldn’t that be 100% then? Minorities set to be US majority

Charlie Brooker Quote

Charlie Brooker on creationism: Darwin’s theory of evolution was simple, beautiful, majestic and awe-inspiring. But because it contradicts the allegorical babblings of a bunch of made-up old books, it’s been under attack since day one. That’s just tough luck for Darwin. If the Bible had contained a passage that claimed gravity is caused by God … Continued

Extending hCard with RDFa

hCard is an HTML-based format for describing contacts (people, organisations, etc) on web pages. It allows you to mark up which elements represent their name, their address, their birthday and so forth. Here’s an example: Toby Inkster Birthday: 1980-06-01. While hCard offers many useful properties that can be used to describe contacts, some are considered … Continued

May Day

Today is May Day and also election day in London. Recent polls have shown alarmingly high support for Boris Johnson (or Alexander Boris de Pfeffel Johnson to use his full name — yes, really!). Much as I enjoy Johnson’s antics on Have I Got News For You, I ask how someone who could barely be … Continued

Twenty Days

Lewes, East Sussex, 6 April 2008 Herstmonceux, East Sussex, 26 April 2008 Source Photos Here are the source photos in their full ten megapixel glory. Feel free to re-use them for non-commercial purposes, but please give me credit. Lewes castle — the castle keep in the snow Roof tops — the snow-covered roof tops of … Continued

Cognition 0.1 Alpha 6

Tonight I've released another alpha version of Cognition, my semantic web parser. Changelog includes: Microformats: Add option (disabled by default) to require <head profile> for microformat support. Microformat profiles are treated as opaque strings! Supports the following profiles: http://purl.org/uF/2008/03/ http://www.w3.org/2006/03/hcard or http://purl.org/uF/hCard/1.0/ http://dannyayers.com/microformats/hcalendar-profile or http://purl.org/uF/hCalendar/1.0/ http://purl.org/uF/hAtom/0.1/ http://purl.org/uF/rel-tag/1.0/ http://purl.org/uF/rel-license/1.0/ No profiles required for rel-enclosure, adr or … Continued

Earth Hour

The Sydney Morning Herald has just (about 2 hours ago) reported that: This year, 26 cities joined Earth Hour as official partner cites, including — along with all of Australia's capitals — Atlanta, Bangkok, Chicago, Christchurch, Copenhagen, Dublin, Manila, Montreal, Odense, Ottawa, Phoenix, San Francisco, Tel Aviv and Toronto. In the US, the lights were … Continued