This post is inspired by an episode of the Art of Manliness podcast, with the psychologist Svend Brinkmann. I guess a good way to introduce it is to give you an example from the podcast. Imagine you go to a shop to buy some milk. You go to the checkout with your milk, and the … Continue reading People: an end or just a means?
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
Testing your view models
In this article I’m going to talk about view models and similar behaviour-free containers of data. I’ll go over why you might want one, and then talk about testing them (yes, really). I use the name view model to make it clear that I'm not talking about models from e.g. machine learning. What is a … Continue reading Testing your view models
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
Your tests are code too
Imagine if someone submitted some production code for review, which had lots of magic numbers and magic text, lots of repetition, long methods etc. Would you say that code was OK? How much of your unit or integration test code is like that? Seeing the wood for the trees Part of the problem with test … Continue reading Your tests are code too
Tests as sheep dogs for your code
Tests can act as constraints on your code, a bit like sheep dogs herd sheep into a pen. One sheep dog stops the sheep from straying to the left, another stops them from straying to the right, and another moves them forwards towards the pen. The sheep are free to roam where they wish, if … Continue reading Tests as sheep dogs for your code