Introduction I stopped studying biology at school when I was 16. So when people tell me about what they’re studying in A level biology it’s advanced enough to be interesting but not too advanced to understand. After a recent conversation about it I wondered why it was resonating with me so much. Not only is … Continue reading How biology is like computing
Category: Coding
Screen grabbers as debugging tools
Nothing big or clever this time. (Is it ever big or clever here?) Just a little trick that I find useful occasionally, that might be of use to you too. Picture the scene - you're debugging some code in your IDE and you realise that you want to take a snapshot of lots of state … Continue reading Screen grabbers as debugging tools
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
Turn the information up to 11
Much of the job of communication is to pass on information to someone. When we design a user interface, it communicates on our behalf. When we write code, including test code, we communicate our purpose for the code to someone else (which could be a future version of ourselves). Sometimes we communicate more obviously and … Continue reading Turn the information up to 11
Explaining virtual methods in C# with words and pictures
In this post I will try to explain virtual methods in C#. There are similar concepts in other languages, like C++ and Java, but I can’t vouch that all the details I go into here will apply exactly to any other language. The whole post is quite long, but I want to get to a … Continue reading Explaining virtual methods in C# with words and pictures
Don’t make your code do the Hokey Cokey
Awkward words and perverse DIY projects have enough in common with some software design problems to teach us things. Instead of always adding stuff on to change something to be the way we want, sometimes we should take things away. These are all instances of a forwards and backwards problem that reminds me of the … Continue reading Don’t make your code do the Hokey Cokey
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
Optimisation
This post and the next are inspired by episodes of the podcast Linear Digressions. In this post I will describe general stuff – what kind of problem is suited to optimisation, and an overview of what optimisation is. In the next post I will go into some details – two related approaches to optimisation, with … Continue reading Optimisation
Imagination
Imagination might not be the first quality you think of when you think of people who build computer systems. However, I think it’s really helpful for many parts of the process – designing, building and testing it. Old English Digression First, a digression into Scandinavia via UK primary schools. This is my friend Tim Eagling … Continue reading Imagination
Lazy initialisation and threads (in C#)
Lazy initialisation is a way to set up everything needed to initialise something, but put off the initialising until later, usually when the value of the thing-being-initialised is needed for the first time. You might want to use lazy initialisation because something is expensive to initialise, and you might not need it. Or because you … Continue reading Lazy initialisation and threads (in C#)