Computer science while washing the dishes 1: The Queue

Calvin and Hobbes said that there’s treasure everywhere.  For a sad geek like me, there’s also computer science everywhere.  Doing the washing up the old school way involves a metaphor for the computer science concept of queue, if you think of people collaborating around the draining board.  Quite a lot of this is a statement … Continue reading Computer science while washing the dishes 1: The Queue

Simple pictures to explain DRY and SRP

The Single Responsibility Principle (SRP) and Don’t Repeat Yourself (DRY) are two common principles of good software engineering.  This article is probably a statement of the bleeding obvious, but I was struck by how the two principles could be illustrated by simple variations on one simple diagram.  I couldn’t remember seeing such diagrams before and … Continue reading Simple pictures to explain DRY and SRP

Optimisation part 2: Hill climbing and simulated annealing

In the previous article I introduced optimisation.  In this article I will go into two optimisation algorithms – hill-climbing and simulated annealing.  Hill climbing is the simpler one so I’ll start with that, and then show how simulated annealing can help overcome its limitations at least some of the time. Hill climbing To explain hill … Continue reading Optimisation part 2: Hill climbing and simulated annealing