<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.9.2">Jekyll</generator><link href="/feed.xml" rel="self" type="application/atom+xml" /><link href="/" rel="alternate" type="text/html" /><updated>2024-04-09T20:16:02+00:00</updated><id>/feed.xml</id><title type="html">dhwthompson.com</title><entry><title type="html">My favourite Git commit</title><link href="/2019/my-favourite-git-commit" rel="alternate" type="text/html" title="My favourite Git commit" /><published>2019-08-30T00:00:00+00:00</published><updated>2019-08-30T00:00:00+00:00</updated><id>/2019/my-favourite-git-commit</id><content type="html" xml:base="/2019/my-favourite-git-commit">&lt;p&gt;I like Git commit messages.
Used well, I think they’re one of the most powerful tools available to document a codebase over its lifetime.
I’d like to illustrate that by showing you my favourite ever Git commit.&lt;/p&gt;

&lt;p&gt;This commit is from my time at the Government Digital Service, working on GOV.UK.
It’s from a developer by the name of &lt;a href=&quot;https://twitter.com/dancarley&quot;&gt;Dan Carley&lt;/a&gt;, and it has the rather unassuming name of “&lt;a href=&quot;https://github.com/alphagov/govuk-puppet/commit/63b36f93bf75a848e2125008aa1e880c5861cf46&quot;&gt;Convert template to US-ASCII to fix error&lt;/a&gt;”.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/assets/the-carley-commit.png&quot; alt=&quot;&quot; /&gt;&lt;/p&gt;

&lt;p&gt;A quick aside: one of &lt;a href=&quot;https://gds.blog.gov.uk/2017/09/04/the-benefits-of-coding-in-the-open/&quot;&gt;the benefits of coding in the open&lt;/a&gt;, as practised at GDS, is that it’s possible to share examples like this outside the organisation that produced them.
I’m not sure who first introduced that idea to GDS – it was well-established by the time I joined – but I’m forever grateful to them.&lt;/p&gt;

&lt;h2 id=&quot;why-i-like-this-commit&quot;&gt;Why I like this commit&lt;/h2&gt;
&lt;p&gt;I’ve lost count of the number of times I’ve shared this as an example of what commit messages can do.
It’s fun because of the ratio of commit message to code change, but that’s not why I think it’s worth sharing.&lt;/p&gt;

&lt;p&gt;In a different organisation, from a different developer, this entire commit message might have been &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;change whitespace&lt;/code&gt;, or &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;fix bug&lt;/code&gt;, or (depending on the team’s culture) some less than flattering opinions about the inventor of the non-breaking space.
Instead, Dan took the time to craft a really useful commit message for the benefit of those around him.
I’d like to step through a few of the ways I think this is a really good example.&lt;/p&gt;

&lt;h3 id=&quot;it-explains-the-reason-for-the-change&quot;&gt;It explains the reason for the change&lt;/h3&gt;
&lt;p&gt;The best commit messages I’ve seen don’t just explain &lt;strong&gt;what&lt;/strong&gt; they’ve changed: they explain &lt;strong&gt;why&lt;/strong&gt;.
In this instance:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;I introduced some tests in a feature branch to match the contents of
`/etc/nginx/router_routes.conf`. They worked fine when run with `bundle exec
rake spec` or `bundle exec rspec modules/router/spec`. But when run as
`bundle exec rake` each should block failed with:

    ArgumentError:
      invalid byte sequence in US-ASCII
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Without this level of detail, we could hazard a guess that this commit fixed some kind of parsing error in some tool or other.
Thanks to the commit message, we know exactly which tool it was.&lt;/p&gt;

&lt;p&gt;This kind of information can be really valuable to document, and is all too easy to lose as people forget the original context behind their work, move on to other teams, and eventually leave the organisation.&lt;/p&gt;

&lt;h3 id=&quot;its-searchable&quot;&gt;It’s searchable&lt;/h3&gt;
&lt;p&gt;One of the first things in this commit message is the error message that inspired the change:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ArgumentError:
  invalid byte sequence in US-ASCII
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Anyone else who comes across this error can search through the codebase, either
by running &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;git log --grep &quot;invalid byte sequence&quot;&lt;/code&gt; or by &lt;a href=&quot;https://github.com/alphagov/govuk-puppet/search?q=%22invalid+byte+sequence%22&amp;amp;type=Commits&quot;&gt;using GitHub’s commit search&lt;/a&gt;.
In fact, from the looks of the search results, multiple people did so, and found out who had found this problem before, when they came across it, and what they did about it.&lt;/p&gt;

&lt;h3 id=&quot;it-tells-a-story&quot;&gt;It tells a story&lt;/h3&gt;
&lt;p&gt;This commit message goes into a lot of detail about what the problem looked like, what the process of investigating it looked like, and what the process of fixing it looked like.
For example:&lt;/p&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;I eventually found that removing the `.with_content(//)` matchers made the
errors go away. That there weren't any weird characters in the spec file. And
that it could be reproduced by requiring Puppet in the same interpreter
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This is one of the areas commit messages can really shine, because they’re documenting the change itself, rather than documenting a particular file, or function, or line of code.
This makes them a great place to document this kind of extra information about the journey the codebase has taken.&lt;/p&gt;

&lt;h3 id=&quot;it-makes-everyone-a-little-smarter&quot;&gt;It makes everyone a little smarter&lt;/h3&gt;
&lt;p&gt;One thing Dan did here that I really appreciate was to document the commands he ran at each stage.
This can be a great lightweight way to spread knowledge around a team.
By reading this commit message, someone can learn quite a few useful tips about the Unix toolset:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;they can pass an &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;-exec&lt;/code&gt; argument into &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;find&lt;/code&gt; to run a command against each file found&lt;/li&gt;
  &lt;li&gt;that adding a &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;\+&lt;/code&gt; onto the end of this command does something interesting (it passes many filenames into a single &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;file&lt;/code&gt; command, rather than running the command once per file)&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;file --mime&lt;/code&gt; can tell them the MIME type of a file&lt;/li&gt;
  &lt;li&gt;&lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;iconv&lt;/code&gt; exists&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The person who reviews this change can learn these things.
Anyone who finds this commit later can learn these things.
Over enough time and enough commits, this can become a really powerful multiplier for a team.&lt;/p&gt;

&lt;h3 id=&quot;it-builds-compassion-and-trust&quot;&gt;It builds compassion and trust&lt;/h3&gt;

&lt;div class=&quot;language-plaintext highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;Now the tests work! One hour of my life I won't get back..
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;This last paragraph adds an extra bit of human context.
Reading these words, it’s hard not to feel just a little bit of Dan’s frustration at having to spend an hour tracking down a sneaky bug, and satisfaction at fixing it.&lt;/p&gt;

&lt;p&gt;Now imagine a similar message attached to a short-term hack, or a piece of prototype code that made its way into production and set down roots (as pieces of prototype code love to do).
A commit message like this makes it much easier to remember that every change has a human on the other end of it, making the best decision they could given the information they had at the time.&lt;/p&gt;

&lt;h2 id=&quot;good-commits-matter&quot;&gt;Good commits matter&lt;/h2&gt;

&lt;p&gt;I’ll admit this is an extreme example, and I wouldn’t expect all commits (especially ones of this size) to have this level of detail.
Still, I think it’s an excellent example of explaining the context behind a change, of helping others to learn, and of contributing to the team’s collective mental model of the codebase.&lt;/p&gt;

&lt;p&gt;If you’re interested in learning a bit more about the benefits of good commit messages, and some of the tools that make it easier to structure your changes around them, I can recommend:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href=&quot;https://blog.mocoso.co.uk/talks/2015/01/12/telling-stories-through-your-commits/&quot;&gt;Telling stories through your commits&lt;/a&gt; by Joel Chippindale&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://tekin.co.uk/2019/02/a-talk-about-revision-histories&quot;&gt;A branch in time&lt;/a&gt; by Tekin Süleyman&lt;/li&gt;
&lt;/ul&gt;</content><author><name></name></author><summary type="html">I like Git commit messages. Used well, I think they’re one of the most powerful tools available to document a codebase over its lifetime. I’d like to illustrate that by showing you my favourite ever Git commit.</summary></entry><entry><title type="html">My brain, and how to help it</title><link href="/2018/my-brain-and-how-to-help-it" rel="alternate" type="text/html" title="My brain, and how to help it" /><published>2018-09-22T00:00:00+00:00</published><updated>2018-09-22T00:00:00+00:00</updated><id>/2018/my-brain-and-how-to-help-it</id><content type="html" xml:base="/2018/my-brain-and-how-to-help-it">&lt;p&gt;I originally published this post internally for my colleagues at &lt;a href=&quot;https://monzo.com&quot;&gt;Monzo&lt;/a&gt; (hence the emoji). It seemed useful enough there that I figured it was worth publishing on my own site. I’ve very gently edited it to remove a couple of references that don’t mean much outside the company.&lt;/p&gt;

&lt;h2 id=&quot;hi&quot;&gt;Hi&lt;/h2&gt;

&lt;p&gt;My name’s David. I started at Monzo a month ago.&lt;/p&gt;

&lt;p&gt;I’m also autistic. I got a diagnosis last July – specifically, Asperger syndrome.&lt;/p&gt;

&lt;p&gt;I find new situations and environments stressful, especially when I need to figure out what the rules and social conventions are, or when it’s otherwise hard to anticipate what’s going to happen. So starting a new job is pretty tough. Especially somewhere as fast-paced as Monzo. Especially when I’m still figuring out what my diagnosis means and questioning my models of the world.&lt;/p&gt;

&lt;p&gt;I’ve told a few people here at Monzo, and the question most people have asked is:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;What can I do to help?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2 id=&quot;what-you-can-do-to-help&quot;&gt;What you can do to help&lt;/h2&gt;

&lt;h3 id=&quot;-give-me-time&quot;&gt;⏰ Give me time&lt;/h3&gt;
&lt;p&gt;I find surprises difficult to deal with. They put me off balance, and it takes time and space for me to recover. That surprise could be a sudden change of direction, a nasty surprise in the codebase, or some critical feedback I’m not expecting. If I’m feeling stressed, it could even be a loud noise.&lt;/p&gt;

&lt;p&gt;I’m not saying you should avoid these – most of them are unavoidable, and critical feedback in particular is incredibly valuable – but be aware that I might need more time to process them than most people.&lt;/p&gt;

&lt;h3 id=&quot;-give-me-clarity&quot;&gt;👨‍🏫 Give me clarity&lt;/h3&gt;
&lt;p&gt;I can’t always guess how someone is feeling, how the things I say will come across, or what someone expects of me. If you expect me to do something, let me know very clearly what it is. If I’ve said something you felt was rude, &lt;strong&gt;definitely&lt;/strong&gt; let me know (but please give me plenty of time to process it: see above).&lt;/p&gt;

&lt;h3 id=&quot;-give-me-context&quot;&gt;👀 Give me context&lt;/h3&gt;
&lt;p&gt;My brain works in rules and systems. It’s part of what makes me good at my job. It also means I struggle if I don’t understand why I’m doing what I’m doing, or how it fits in with the wider goals of the team or the company. The more context you can give me about the thing I’m doing, how it fits together, what the background is and why it’s important, the happier and more useful I’ll be.&lt;/p&gt;

&lt;h3 id=&quot;️-take-turns-talking&quot;&gt;🗣️ Take turns talking&lt;/h3&gt;
&lt;p&gt;This is a small thing, but it makes a huge difference to me. If there are multiple people talking at once, I’ll really struggle to follow what’s going on.&lt;/p&gt;

&lt;h2 id=&quot;ama&quot;&gt;AMA&lt;/h2&gt;
&lt;p&gt;Do you have more questions? Have I said something that isn’t clear? I’d love to keep talking about this. For one thing, it helps me clarify my own understanding of my brain and how it compares to everyone else’s brain. Feel free to ask me anything.&lt;/p&gt;</content><author><name></name></author><summary type="html">I originally published this post internally for my colleagues at Monzo (hence the emoji). It seemed useful enough there that I figured it was worth publishing on my own site. I’ve very gently edited it to remove a couple of references that don’t mean much outside the company.</summary></entry><entry><title type="html">Being autistic</title><link href="/2018/being-autistic" rel="alternate" type="text/html" title="Being autistic" /><published>2018-04-02T00:00:00+00:00</published><updated>2018-04-02T00:00:00+00:00</updated><id>/2018/being-autistic</id><content type="html" xml:base="/2018/being-autistic">&lt;p&gt;On a Thursday last July, in a clinic just outside Cambridge, a psychologist sat down with me and confirmed that I have Asperger syndrome.&lt;/p&gt;

&lt;p&gt;It wasn’t a huge surprise – after a slew of questionnaires, an &lt;a href=&quot;https://www.amazon.co.uk/dp/1843106698/&quot;&gt;extensive reference book&lt;/a&gt; and a year-long waiting list, I was already pretty convinced I knew what the answer was going to be. Even so, it was a big deal, and has been a big deal since, to reframe and understand the last three decades. And now here I am. Telling you.&lt;/p&gt;

&lt;p&gt;Hi. This is me.&lt;/p&gt;

&lt;h2 id=&quot;a-very-brief-introduction-to-asperger-syndrome&quot;&gt;A very brief introduction to Asperger syndrome&lt;/h2&gt;
&lt;p&gt;Asperger syndrome is a form of autism. Like the autism spectrum itself, Asperger syndrome covers a whole range of traits, which different people are going to have to different degrees. Probably the most well-known traits are around highly specialised, very intense interests, and difficulties understanding body language and subtext. I don’t want to go into much detail here, as other people and organisations have already written far better introductions than I ever could. If you’d like to know more, the National Autistic Society has a &lt;a href=&quot;http://www.autism.org.uk/about/what-is/asperger.aspx&quot;&gt;pretty good introduction to Asperger syndrome&lt;/a&gt;, and some broader information about &lt;a href=&quot;http://www.autism.org.uk/about/what-is.aspx&quot;&gt;the autism spectrum as a whole&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Before I start delving into the details, I feel it’s worth making clear that this is all my own personal experience of my own personal brain, and doesn’t necessarily apply to other autistic folk. It &lt;em&gt;might&lt;/em&gt;, but please don’t make too many assumptions. On top of that, I’m still relatively new to this, and &lt;a href=&quot;https://adactio.com/journal/13521&quot;&gt;writing as I learn&lt;/a&gt;, so there may well be parts I’ve misunderstood, and there are definitely parts I haven’t figured out yet.&lt;/p&gt;

&lt;p&gt;With that said, here’s what I’ve figured out so far about how my mind works.&lt;/p&gt;

&lt;h2 id=&quot;how-my-mind-works&quot;&gt;How my mind works&lt;/h2&gt;
&lt;p&gt;My mind’s pretty specialised. It’s very good at a number of things most people’s minds struggle with, and it struggles with a number of things most people do without even thinking.&lt;/p&gt;

&lt;p&gt;As far as I’ve been able to figure out so far, the things my mind is best at are details and systems. It‘s part of what makes me a good programmer: I can hold a lot of detail in my head about how a system fits together, I can mess around with it more easily than most people, and I can pick up on details other people might miss, such as potential bugs. A lot of the things I enjoy (and seem to be pretty good at) are those where there’s an underlying system to figure out and master – computer games, martial arts, even cooking.&lt;/p&gt;

&lt;p&gt;Then there’s a few things my mind struggles to handle. Most of them revolve around people.&lt;/p&gt;

&lt;p&gt;I’m not always great at figuring out what someone else is thinking, or feeling, or even dropping hints about. I can take educated guesses, for sure, but I don’t necessarily get it right. It also takes a lot of work to keep track of all the social cues going on whenever there’s a conversation happening, and all the social conventions most people seem to follow without even thinking. I can think of several times when someone has asked me how my weekend went, and it’s completely slipped my mind that the appropriate response is to ask them about theirs too. It’s not that I don’t care; it’s that I’m having to concentrate so much on the rest of the social cues that I take longer to catch up with how the conversation is supposed to go.&lt;/p&gt;

&lt;p&gt;All of this is usually manageable when I’m talking with one person, but add in a few more people to keep track of and I really start to struggle. Throw in some background noise, or get several of those people talking at once, and I’ve got very little chance of following what’s going on.&lt;/p&gt;

&lt;p&gt;Another thing I’ve noticed is that surprises throw me pretty hard. While other people seem to be able to roll with surprises fairly easily, it takes me longer to recover, and I’m less able to function in the meantime. That surprise might be an unexpected change of plans, an abrupt change in a discussion topic, or even a sudden loud noise. It’s probably going to knock my brain sideways for a while, and I’m going to be that bit twitchier until I’ve recovered.&lt;/p&gt;

&lt;p&gt;A few things don’t really count as good or bad: they’re just things my brain seems to do a bit differently. My memory seems to have some pretty strong opinions about what is and isn’t worth remembering. Movie quotes? Yup. Which actor was in which episode of which series, or voiced which character in which game? Keep it. Different types of bird or plant? Nope; unless I can eat it, it’s already forgotten.&lt;/p&gt;

&lt;p&gt;There’s a whole load more traits I could cover here – also, I don’t doubt, a whole pile of traits I haven’t yet identified as a part of this particular pattern – but I hope that gives at least a flavour of what makes my mind a bit different from most.&lt;/p&gt;

&lt;h2 id=&quot;what-this-means-for-me&quot;&gt;What this means for me&lt;/h2&gt;
&lt;p&gt;On the surface, nothing’s really changed. I’m still exactly the same person I was before, and have always been; the way my brain is wired is the way my brain has always been wired. None of that has changed; what’s changed is that now I know about it. I can better appreciate the things I’m really good at, and I can better accept the things I struggle with.&lt;/p&gt;

&lt;p&gt;Perhaps most importantly, I think this means I can try just a bit less to fit in with what I think other people expect of me – and what I’ve grown up expecting of myself – because all that’s going to achieve is a second-rate emulation of another person. Instead, I can accept that I’ll need to make a few adjustments when dealing with other people, and maybe ask those people to make a few adjustments in turn.&lt;/p&gt;

&lt;p&gt;The most common question people have asked me is whether this diagnosis is a good thing. In short: yes. Yes, it is. For the technically-minded, it’s like struggling with a problem for what seems like an eternity, then finding that one abstraction – that one missing piece of the puzzle – that makes the solution fall neatly into place. Except that problem is the last three decades of your life. For the less technically-minded, it’s like &lt;a href=&quot;https://web.archive.org/web/20220608212852/https://candidlyautistic.tumblr.com/post/146042314375/sparrows-and-penguins-or-an-autism-story-by-j&quot;&gt;finding out you’re a penguin&lt;/a&gt;. Either way, it’s very good indeed – nothing short of life-changing, in fact – and I’m looking forward to finding out more about what it means.&lt;/p&gt;</content><author><name></name></author><summary type="html">On a Thursday last July, in a clinic just outside Cambridge, a psychologist sat down with me and confirmed that I have Asperger syndrome.</summary></entry></feed>