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
The user, not your user interface, is the star of the show
As programmers and designers, it's easy to get really invested in our work. This is great if it helps us do a good job, but the temptation is to think that we and our work are the most important things. That's not true - it's the user. When I was at school and college, I … Continue reading The user, not your user interface, is the star of the show
Authentication, authorisation and the chain of trust
I recently walked by my old college. There was a sign outside: Closed to visitors. I realised that two cards in my wallet would get me in, which made me think of some security concepts: the difference between authentication and authorisation, and the chain of trust. I’ll go into those a bit in this article, … Continue reading Authentication, authorisation and the chain of trust
People: an end or just a means?
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