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. […]

Read More…

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 […]

Read More…

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 […]

Read More…

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 […]

Read More…

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 […]

Read More…

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 […]

Read More…