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