This is a transplant from my blog and is light on recent work. I'll try to update it more later.
At 14k visits (yes I know that’s not a lot), this is my most read article ever. It got linked from a bunch of places, including one of the new scientist blogs.
Which really makes me wish it weren’t so badly written. In order to compensate for that I rewrote it. The new version is substantially better written but was so much less topical by then that it’s not had nearly the same level traffic.
The essential idea, which I proposed mostly as a thought experiment, is that when electing a large number geographic constituencies the correct election procedure to use is random ballot – everyone votes, you pick a random voter and use their choice. I’ve since come around to thinking this is actually a really good idea, but alas it will never get implemented.
I’ve written more on this subject since:
- An implementation strategy which is hard to game
- Some additional reasons why I think it’s a good idea
- On why using deterministic methods for voting is just too random
- More on how to win a majority under random ballot (spoiler: You do it by having a majority of the votes, or near enough as makes no difference, but how to optimise your chances of getting a larger number of seats depends on how close to a majority you have)
- A variation for multi-member constituencies, (which retains proportionality but allows tactical voting)
I got very vocal and angry about the AV referendum. This is in fact what prompted the random ballot post. I had recently written Hammer Principle and so gone down a bit of a rabbit hole of voting theory. As a result it was really obvious to me how bad the existing system was. The fact that the no to AV group were lying through their teeth helped fuel my outrage.
I’ve since written various things both on the practical details of the vote in the UK and on voting theory at large:
- An elected UK government has not had the popular vote since 1931
- AV may not be Condorcet but you can easily make it so
- A proposal for electoral reform: Don’t make every constituency use the same system. Instead regulate the set of allowed systems and create a process for changing it.
- Irrelevant alternatives aren’t. An example demonstrating that Arrow’s theorem shouldn’t be considered all that significant a problem for preferential voting. As it happens I’m no longer convinced preferential voting is a good idea, but Arrow isn’t the reason for that.
I stopped using Scala long ago, and this article is no longer relevant to the current implementation, which I believe uses an explicit manifest object and is much more reliable. This was my description of the old mechanism where arrays could be backed by either an object array or a primitive array and what would happen was essentially that when you realised it as a primitive array the implementation would “snap” to that form. It was a very clever but ultimately quite flaky way of getting around the limitations of the JVM for generics.
The reason it’s got quite so much traffic over the years is that it’s linked from the proposal for the fixed array implementation that came in in 2.8.
Some other “Here’s how this bit of Scala works” posts:
- How packages work in Scala. This is the old system. I still think it was a good system in itself, but unfortunately it was completely shafted by the combination of the Java conventions and the way package resolution from the file system worked.
- A note on a useful feature of the Scala class system that most people seemed to miss. I believe this one to still be valid.
- An introduction to implicit arguments. There are very few programming languages so bad that they have nothing to recommend them (Scala is pretty far from being one), so as a result pretty much every language I’ve ever used has features I miss when I’m not using it. Scala has a few of them, but implicit arguments unquestionably top the list. This is my attempt to write an introduction with lots of an examples on how to use them. I believe it to still be accurate – certainly it still gets linked from places and gets some traffic, so I hope its’ still accurate.
- A little detail on the difference between Java wildcards and Scala existential types.
- A more substantiative post about Scala existential types work. This seems likely to still be mostly accurate but I don’t know if it’s still 100%. It’s certainly still quite popular.
- Once upon a time there was a Scala trait called Application which broke everything. You ended up running your entire application inside class initialization. This turns out to be a really bad idea on the JVM. I believe this was fixed by introducing deferred initialization rather than by removing Application.
Other posts from the Scala years:
- No, seriously, why scala? An attempt at a pro-Scala advocacy piece that was a little more interesting than the standard “zomg functional programming is amazing!!1” fluff pieces
- Why not Scala? A post on its downsides. Obviously some of these have now changed. I could write an updated piece, but I’m not going to. Someone who actually still uses the language is far better placed to complain about it.
- How do you talk about Scala? In which I asked people about how they sold other programmers on Scala.
One of my more read articles, mostly because it’s linked from the Wikipedia page on Timsort (not my doing, I promise).
I unfortunately never followed up with a part 2. I got about a third of one written before it got stuck in the eternal drafts folder of doom but decided not to bother – I got further with my understanding (although I certainly couldn’t recite all the details off from memory) but then realised I wasn’t all that interested in learning the details of the sorting algorithm.
This was part of the storm of activity I had at the beginning of this year. I think I had three popular articles going in a week (and yet unlike last week HN didn’t bring my site down once. Oops). I forget what triggered this. I think it might have been the way Padrino handled certain problems, but really it could have been anything Ruby related. Basically: People who handle and report errors often seem to go out of their way to make things difficult to debug. This makes me sad and angry and you, the reader, thus get to listen to me being sad and angry. Apparently this sad angriness (sandgriness?) struck a chord with a lot of other people.
I also published A rewritten version of the manifesto because some people misunderstood the first one. There’s less shouting and more condescending prescriptivism. A friend described it as “the most passive aggressive thing she’d ever read” because of how obviously pissed off I was and yet going out of my way to be scrupulously polite in it. This is almost as popular as the inspiring post.
Relatedly, I appear to have strong opinions on exceptions:
- The best way to handle exceptions. TLDR, don’t. If you don’t know what to do with the exception, don’t try to do anything with it. Let it bubble up to the top and let the code you have for handling crashes (which should either be empty because the language default is good or solid and essential) handle it.
- And mostly unrelated but it doesn’t fit anywhere else and I still think it’s important: It’s totally OK to use exceptions for things other than error reporting.
- An example where someone else providing debugging heuristics in error reporting saved my bacon.
- Complaining about how bad the python standard library error messages are
(original title: How did you get started so quickly?)
A rather recent post, so if you’re reading this archive post close to when I wrote it you’ve probably already read it. This post had the surprising characteristic of being remarkable well received on hacker news and derided on reddit. Clearly this means that Hacker News are better people than Reddit. Um.
This starts out with some practical advice on the philosophy of learning and rapidly descends into some very speculative things about mental models and how to apply them. I actually have more of the mental models stuff to come which I’m currently procrastinating from by writing this post instead. Such is life.
In general I care quite a lot about the art of problem solving and how it’s applied to software development, and I have a few other posts on that subject:
- A parable about problem solving in software development. Original title: “What the fuck are we doing?”. This is what happens if you let problem solving run unconstrained and don’t ground it in actual problems worth solving. I’ve also done a spoken version of this.
- The unconstrained problem solving is particularly ironic given that I already knew this lesson, having written about it previously under “Are you solving the right problem?“
- Problem solving when you can’t handle the truth isn’t about software development at all. It is about a useful advanced problem solving technique though.
- A probably useless mathematical heuristic for problem solving. The maths might be useful or not, I’m not sure, but I think the overall idea it’s aiming for is useful: Run experiments which maximize the rate at which you gain information.
- A tool for thinking about how the effort required to develop software depends on you r methodology.
You have no need to read this post. I practically guarantee it. If you’re not experiencing this problem then you don’t care. If you are experiencing this problem then you’ve probably found this page due to my advanced SEO skills (read: I struggled for ages to find anyone explaining what in the actual was going on, couldn’t find anything, so when I figured it out made sure that other people would not suffer this problem). This still gets a lot of traffic and every now and then someone will give me warm fuzzies by saying “Thanks! This completely solved a really annoying problem for me”.
Another example of my doing this that you don’t really care about is my posts on Linux wifi recently. Unfortunately those are less helpful because I haven’t actually solved the problem (I still haven’t. I’ve avoided it with a £15 wifi dongle).
This was a surprisingly popular article about a cute hack you can do in Haskell. I totally stole it from someone else at the time but was never able to figure out who I stole it from (I think it was someone on some mailing list). Basically: You can mess with Haskell syntax to make it look almost exactly like an OO language with surprisingly little difficulty.
This is part of what I think of as “The programming language years”. I still care about programming languages and like picking up new ones (it’s pretty easy using the “How did you get started so quickly?” guide, though knowing a variety of them already definitely helps with that). But once upon a time I was really quite obsessed with languages and thought that solving them was the key to a lot of software development’s problems. These days I think not being so completely dysfunctional is the key to solving a lot of software development’s problems and that most of our problems are social. I miss the days when I thought it was about programming languages. Those were nice, cuddly, delusions.
Other things from the programming language years:
- Tell us why your language sucks. The thesis is that all languages suck in one way or another, and most criticisms of languages are shallow because they come from people who don’t use that language. This was an opportunity for people to complain about the languages they actually use and like. I think it went pretty well.
- Criticizing programming languages. Me deliberately saying some good and bad things about different languages I used. Some of these are quite shallow (e.g. I could probably say more interesting things about python now), some of them are pretty fair.
- Functional code != Good code. This might actually be an early sign of my disillusionment. A post that spells out in detail the seemingly obvious point that making your code more functional doesn’t automatically make it better and that what you actually need is better factoring and more modularity.
- Functional programming lies. AKA “Please engage in truth-based advocacy, thanks”.
- A problem of language. What do we actually mean when we say “This is a functional programming language”? Draws the distinction between “This thing exhibits X behaviours” and “This is an X thing”, which I think is important and undervalued. I keep meaning to write another post on a similar subject in a different context.
- I later elaborated on how you don’t actually need definitions to seek agreement.
- Notes on the design of a Haskell API. Some problems I had when trying to design a metric space API in Haskell.
- What’s a monad? So, yeah, I’ve written a monad tutorial. I’m not proud of this.
- Then I accidentally wrote another one.
- Interest bandwidth. The theory that interest in programming languages is strongly correlated to lack of interest in what you’re doing with them. This was my theory at the time for my waning interest in the subject. I think it was true but incomplete.
A more recent thing which isn’t from the programming years but fits into a similar category is How learning Scala made me a better programmer, in which I reflect on the fact that writing code in a language with a buggy compiler is surprisingly useful.
This was a bit of a transition point for me. The actual post itself is not that phenomenal, but it marks the point where I started writing about feminism and related issues and started being more vocal about them, both online and in person. I’d been what I suppose you might call a closet feminist before that – it’s not that I was secret about my feminism, but I didn’t make a big deal of it. This was the point at which I realised that this was not OK and that I needed to start getting on with helping make the world a slightly less shit place.
Annoyingly I haven’t actually done all that much explicit calling out of sexism recently (I’ve corrected some people on various things, but it was more of a “Hey, actually the world works like this” “oh, ok” scenario than “Hey you’re being sexist. Can you stop?”). I think this is mostly because I haven’t been in situations where it was necessary, but I’m not sure why that is and I think I’ll keep an eye on this.
I have done a certain amount of shouting on twitter on the subject, and I’ve definitely been a bit more vocal on the subject in casual conversation, but I’m not sure how substantial that’s really been.
I also promised at the time to try and document this. Again, failure. The only documented case of it was relatively near the beginning with if programming language articles were people. A workplace incident in which someone forward around a “If programming languages were women” post. I was not amused.
A more recent example is my I am angry too piece, in which I write about men’s tendency to dismiss women’s anger as a way to avoid hearing about things that make us uncomfortable.
This discussion around hiring practices maybe also counts. I think I might be reaching though.
I do have a bunch of posts about identity, which are clearly inspired by a lot of thoughts around intersectional feminism. I don’t know if I would call them explicitly feminist, but I think that’s clearly where I’m coming from:
- I believe I can fly. Some thoughts about what we consider part of our identity and how these may not correspond to “objective” reality. I’m clearly on the fence on the subject (and remain so) but as a result people from both sides basically went “Yes exactly! This completely supports my point!” about it. I still think it’s an interesting exploration though.
- You are not your labels. A post about the difference between your identity and the words you use to describe your identity, especially in the context of sexuality. In it I attempt to explain everything ever by the failure to understand the difference between these two. This had an interesting split in its reactions. People who knew me received it mostly positively (they didn’t necessarily agree, but they thought it was an interesting point). People who didn’t know me so well were… more mixed. Apparently a mostly-straight cis white dude who works in tech gets pattern matched to some relatively unpleasant behaviours when talking about identity. Not all that surprising and hard to blame people for.
- So I wrote a follow up post in which I made it fairly explicit that I wasn’t saying that identity wasn’t important.
In which I outline my three step program for writing better software. It approximately goes:
- Smash the system
- Smash the patriarchy
- Figure out how to write good software
It’s proven to be fairly popular, I think mostly because people who are interested in both social justice and software are extremely keen to share it.
Also on a more or less feminist topic. Basically: Knowing more can make your life worse. The reason for this is not that knowing more is harmful it’s that your life was currently “better” because you were less aware that you were causing problems for other people.
- an (overly simplistic) theory of moral change. I don’t think thought experiments about trolleys are a good way to explore normative theories of morality. What is?
- The moral argument for rationality
A distilled list of questions to ask companies before joining. I did ask all of these at my current employer, but I confess I didn’t guide my decision by these as thoroughly as I might have. To be honest, I completely failed to stick to my guns. Next time, whenever that is, I will do better.
(And the world)
Also in this series:
- Some earlier thoughts on how I would shape the world to my whim
- More thoughts on this
- Greetings from the ministry of dancing, getting high and fucking. Not actually my idea, though I think it contains some good ones. A challenge was set to provide concrete policy proposals for such a ministry, so I provided some.
I’m pretty disillusioned with the state of modern democracy, which meant I was very receptive when Terence Edent gave a talk about how to effect real political change: By bribing MPs, because they turn out to be really quite cheap. This then collided with my peculiar obsession with randomisation and came up with this model for bribing MPs without directly bribing MPs. I then came up with another one.
I sometimes write fiction. I’m not actually very good at it (mainly due to being unable to write good dialogue) but sometimes it turns out well anyway (mainly due to being able to avoid needing to write dialogue). Notable examples:
- Gates – a story being told to you in a bar
- Spam – my contribution to the rare genre of post-singularity humour
- They called me mad – secret agent vs mad scientist. Contains actual dialogue. Also contains my favourite line from any of the fiction I have written.
Less notable but still decent examples:
- Dark Lord – a hero rises to defeat the dark lord. Unfortunately the dark lord was already defeated with high explosives.
- The man who named the stars – a vaguely lord Dunsany inspired fairy tail / creation myth..
This was actually inspired by my world domination ideas for health care systems.
It’s an interesting way to do a business model: Give the service away for free, but dedicate a certain percentage of resources to the people who pay you the most, with people being able to pay as much or as little as they like to get access to this (and the amount of access you get scaling with the amount of money you’ve paid (plus some bonuses for regular customers). It has some problems, some of which I later patched.
A practical and linguistic defence of people who describe themselves as “Vegetarian but I eat chicken” against people who immediately go “Well you’re not vegetarian then, are you?!” in a self-righteous “Gotcha!”. I get a surprising amount of Google traffic for this post.
I spent a little bit of time looking at the question of when one real valued random variable is “better” than another, where a higher score is always better but we’re not sure about the distributions. I gave a nice definition of the minimal possible partial order we accept has to be included in this and explored some of its properties.
I later proved that this was equivalent to the nice characterisation that one distribution dominated another iff it had greater or equal expectation under every monotonic increasing transformation.
I also characterised this for normal distributions. In short, a normal distribution dominates another iff it has greater or equal mean and the same variance. Normal distributions with distinct variances are incomparable under this order.
I defined a thing I called a subset consistent decision strategy. I provided a full characterisation of all finite ones, and then did some work on characterising infinite ones:
- The countable version looks very like the finite version
- The uncountable version is a lot more complicated
One of various “isn’t my life interesting?” amusing stories. Occasionally funny things happen to me and I blog about them. These tend to be surprisingly well received, although never get that much traffic. Other examples include:
- That day where I had a cold shower then interrupted a funeral procession
- When I accidentally found myself with a pile of 40 £1 coins.
As if the 80-some links that I’m already providing in this post weren’t enough, here’s a whole bunch of book recommendations.
I also have a similar post for webcomics.
I have no idea where else to put these but think they’re worth reading
- In which I explain how this blog is an insidious ploy to take over your mind and replace it with a copy of my own. Despite telling you how the trick is done, it works anyway.
- When I designed a magic system for a fantasy universe. It’s designed to strike a nice balance between what I perceive as two extremes. It’s very post-modern reality-is-what-we-make-it but I still rather like it.
- I may be an atheist, but I have a religion of sorts. It’s called The Cult Of The Giant Global Brain. Come join us. We have cookies.
- The role of a CTO. A conversation about how CTOs work.
- A reminder that you’re not supposed to feel tired all the time and it may be a sign that you should talk to a doctor
- Why you should expect non-transitive dice to exist if you know much about voting theory
- An amusing idea for creating a common currency as a financial instrument which anyone can back
That’s it for now. I’ve missed out the cooking and fiction sections entirely, and I suspect there’s some interesting stuff lurking in the early days of my archive, but the process of curating this is exhausting. I may come back to it later, but I don’t have a good track record of doing that.