Category Archives: Open sourcing my brain

I think I don’t think like I think I think. I think

You may have noticed I have a category for some of my posts labelled “Open sourcing my brain“.

The basic idea is simple: I appear to be fairly good at thinking. I would like other people to be better at thinking. Here, let me share some of the ways I think so that you can think like me and thus be better human beings.

Setting aside the insufferable arrogance through which I view the world (which you’re probably acclimatized to by now if you read this blog), there’s one major problem with it.

That problem is of course that every single post in it is a complete lie.

Continue reading

This entry was posted in Open sourcing my brain on by .

Notes on instrumentalist reasoning

Warning: David is doing philosophy without proper training. Please be alert for signs of confusion and keep your hands inside the vehicle at all times.

I was having some interesting discussions with a Paul Crowley yesterday evening. He and I have a large enough overlap between our beliefs and interests that we can disagree vehemently about almost every philosophical issue ever.

The particular point of disagreement here was about epistemic vs instrumental reasoning. For the sake of this post I’m going to oversimplify these to mean “I want to believe things that are true” vs “I want to believe things that are useful”.

I’m very much in the instrumentalist camp.

Continue reading

This entry was posted in Open sourcing my brain, rambling nonsense on by .

Notes on aspirational mental models

So I wrote a thing for the Lumi blog explaining how the new personalised topic timelines work.

I’ve really enjoyed implementing this chunk of work. Part of this is that I get to play with recommender systems and scoring algorithms and other fun stuff like that. Part of it is that I’ve been enjoying the process of developing it. It’s been a while since I’ve got to come into an unfamiliar code base of this complexity and been given the mandate to make sweeping changes to it (the last time would have been probably about 4-5 years ago at Trampoline Systems when I had only about 2-3 years of dev experience under me and was much less sure what on earth I was doing). So as well as doing the work I’ve been watching myself do the work and observing how I’m applying the tools of thought I’ve built and sharpened in the meantime to the task, and seeing if there’s anything interesting emerging that I want to pull out of the process and reify into something I can use again.

Well I spotted an interesting one. It’s something I’ve definitely found myself doing in the past, but I’d previously done it in a reversed order that caused me not to notice: When I design a system I usually start with an abstract model which I think is powerful enough to do what I want and flexible enough that I can modify it when I find that it doesn’t. So I start with a mental model of how the system is going to work and then add patches to it as I implement it and encounter how the real world is messy and complicates my nice abstract design.

Sometimes it turns out that the abstract design is flawed and I just have to replace it. Most of the time though I find it basically works except details, and those details are ones you can ignore unless you’re actually looking right at them, so I basically store it as “Here’s how to think about it. Here are some details that deviate from that”. It’s essentially what I said previously about having mental models as variations on mental models I’m already familiar with except the mental model I’m patching against is for something that never really actually existed.

What I’ve caught myself doing with the timeline work is reversing this process. Thinking back, this is definitely something I’ve done for a while but I’ve not been quite so overt about it and it feels like it’s worth drawing attention to.

Essentially the idea is I’ve built a mental model of how I want the timelines to work rather than how they actually work. Oh, I’ve got a mental model of the grim reality too, but I keep it alongside the shiny pretty one of how it’s supposed to work. I haven’t just pulled this out of thin air, I’m pretty sure it’s quite close to the intentions of the original authors. Certainly I talked to them heavily in building it. Bits of it though are definitely wholly of my creation.

How do I use this mental model? Well part of it is just as a vehicle for understanding – well abstracted models are easier to reason about. But I’m not that bad at reasoning about the detailed realistic model either.

I think the main use of this model though is that it’s a vehicle for change. When I’m trying to reason about how to improve things or make a new feature, I first design it against the aspirational mental model of how I want things to work. I then check it against the real model of how things actually work. Sometimes the result is that actually my idealised version is completely impractical and I stick it on the shelf of ideas that don’t currently work but I should remember to look at again later. Sometimes the result is that it will work fine with no real difficulties and I just implement it.

Often though the result is something more interesting: It will almost work, but there’s this detail where the real and the idealised versions of how things work don’t quite line up.

This can then be resolved in one of two ways. One is that this has exposed a flaw in the aspirational mental model and I have to update it (this doesn’t happen too often). The other is that I fix the code to look more like the aspirational mental model.

And this is really what I mean when I say that the model is aspirational. It’s not exactly a design document. It’s more of a tool to guide refactoring. It lets me simultaneously have the “system I would design if I could do a complete rewrite” in my head and not do that complete rewrite but still get about 60% of the benefits of doing so by fixing it whenever the fact that I haven’t gets in the way.

I’m still observing the effects of this and trying to decide whether it’s a genuinely good idea or whether I’m over-fitting, but so far it seems pretty good.

This entry was posted in Open sourcing my brain, Uncategorized on by .

How to quickly become effective when joining a new company

The other day my colleague Richard asked me how I managed to get started at Lumi quite so quickly. It’s a good question. When I started here I was pretty much doing useful work from my second day (I did manage to get “code” out into production on my first day, but it was my entry on the team page). I think I handed them a feature on day 3. For added funsies I’d only been writing Python for a month at that point.

I’ve seen enough new starters on equally or less complicated systems that I’m aware that this is… atypical. How did I do it?

The smartarse answer to the question is “obviously because I’m way smarter than those people”. As well being insufferably arrogant this isn’t a very useful answer – it doesn’t help anyone else, and it doesn’t help me (knowing how I do something is useful for me too because it allows me to get better at it and apply it to other things).

So I’m putting some thought into the question. This is largely just based off introspection and attempting to reverse engineer my brain’s behaviour. I’ve no idea how portable this advice is or even if it’s remotely accurate, but hopefully some of it might be useful.

There are essentially three key principles I apply, all about information:

  1. Acquire as little information as possible
  2. Acquire information as efficiently as possible
  3. Use the information you acquire as effectively as possible

I’ll elaborate on each of these and how to do them.

Acquire as little information as possible

This one is the only one that might be counter-intuitive. The others… well, yes. You want to acquire information efficiently and use it effectively. That’s kinda what learning quickly means. But acquiring as little information as possible? What’s that about? Surely when trying to learn stuff you want to acquire as much information as possible, right?

Wrong.

This sort of thinking fundamentally misunderstand the purpose of learning, at least in this context.

Learning is only useful when it allows you to get things done. Filling your brain with information is all very well, but what if you’ve filled your brain with entirely the wrong information?

Work example (a hypothetical one. I’ve not seen this happen, though I have seen similar): Suppose you diligently sit down, trace through the database schema, learning how everything fits together. You spend about a week doing this. Then you get told that that’s the old schema and we’re 2/3rds of the way through migrating to an entirely new data storage system after which that schema will be retired. Now the knowledge of the history isn’t entirely useless, but there’s certainly more useful things you could have been doing with that week.

The goal of learning as little information as possible forces you to do three important things:

  1. It forces you to learn the right information. If you only acquire information when it’s absolutely necessary then that information was by definition useful: It enabled you to do the necessary thing.
  2. It forces you to do things you can actually achieve soon. If task A would require you to learn a lot and task B would require you to learn a little, do task B. It will take you less time to learn the prerequisites, so you’ll get something achieved quickly.
  3. It prevents you from getting distracted by the immensity of the task of trying to understand everything and forces a more useful learning discipline on you by giving you concrete places to start.

“But David!”, I hear you cry in horror so profound that it causes you to use exclamation marks as commas, “Are you suggesting that learning is bad? That I shouldn’t try to learn how things work?”

Rest your mind and set aside your fears, for I am not!

The thing about information is that once you have acquired it you can build on it. Every little bit of knowledge you put into your head provides you with a framework on which to hang more knowledge. The journey of a thousand miles begins with a single step. Other profound sounding metaphors that convince you of the wisdom of my advice!

We’re essentially iterating this procedure over and over again. “What can I do? Oh, there’s a thing. Lets do that. Done. What can I do now? Oh, hey, there’s another thing which I couldn’t previously have done but now can because I’ve learned stuff from the last thing I did”. By acquiring our knowledge in little bite sized chunks we’ve rapidly consumed an entire information meal.

As well as interleaving getting things done with learning things, I think the quality of education you get this way is better than what you would otherwise get because it contains practical experience. You don’t just learn how things work, you learn how to work with them, and you learn a lot of concrete details that might have been missing from the high level description of them.

Now go back and read this section again (if you haven’t already. Don’t get stuck in an infinite loop and forget to eat and die. Because I’d feel really bad about that and it’s not an efficient way to learn at all). It’s literally the most important bit of this post and I really want you to take it on board.

Acquire information as efficiently as possible

Here is my knowledge acquisition procedure. I bequeath it to you. Use it well:

  1. Can I figure out how this works on my own? (5 minutes)
  2. Can I figure out how this works with googling and reading blog posts? (15 minutes)
  3. Ask someone to explain it to me (however long it takes)

OK, I know I said the previous section was the most important thing in this essay, but this one is pretty important too. For the love of all, please do not sit there ineffectual and frustrated because you can’t figure out what’s going on. It’s nice that you don’t want to bother your colleagues, and the first 20 minutes or so of trying to figure things out on your own is important as a way of preventing you from doing that too much, but your colleagues need you to be useful. They also probably possess the exact information you need. It is their responsibility and to their benefit to help you out when you get stuck.

Use the information you acquire as effectively as possible

This is a fuzzy one. It’s basically “Be good at thinking”. If there were a fool proof set of advice on how to do this the world would look very different than it currently does. Still, here are some ideas you might find useful.

Here is roughly what my thinking procedure looks like. Or, more accurately, here is my inaccurate model of what my thinking procedure looks like that I currently use to make predictions but don’t really expect corresponds that exactly to reality.

Err. That paragraph might be a bit of a clue as to what I’m about to say.

If I may get all meta for a moment: What is the purpose of knowledge acquisition?

I mean, sure, you want to get stuff done, but how does knowledge help you do that?

To me the value of knowledge is essentially predictive. You want to be able to answer two questions:

  1. If I do X, what will happen?
  2. If I want Y to happen, what should I do?

These two questions are natural inverses of each-other. In principle a valid algorithm for question 2 is “Think of all possible values of X and see if they cause Y to happen”. Everything else is just an optimisation to the search algorithm, right?

First I’ll go into how to answer question 1:

At its basic it’s two words. “Mental models”

A mental model is essentially an algorithm you can run in your brain that lets you put in actions as inputs and get outcomes as outputs.

They can be implicit or explicit (note: This is my terminology and is probably non-standard): An implicit mental model is essentially one that you can run without going through all the steps. You don’t need to be able to describe the model explicitly, you just know the answer. Essentially what most people mean when they say something is intuitive is “I have an implicit mental model for how this works”. You’re essentially pretty comfortable working with anything you have an implicit mental model for and can probably get things done with it pretty readily.

Explicit mental models are more work. You have to think through the steps linearly and laboriously in order to get the answer. But they’ve got a lot of benefits too:

  1. They tend to be more accurate. I find implicit mental models are full of shortcuts and heuristics which makes them really efficient when they work but often leaves some major gaps.
  2. They’re easy to fix when they’re wrong. And mental models will be wrong, all the time. The chances of you always being able to perfectly predict things are basically zero. An explicit mental model you can just patch, but adjusting your intuitions is much harder.
  3. You can explain your reasoning to other people. This is especially useful when you’re stuck and want to talk a problem through with someone else.

So both types of mental models have costs and benefits. So which do we choose?

Answer: Both!

Once you think of mental models in terms of being able to predict how things behave instead of truth about how things work you can realise that having multiple mental models of how something works is not only fine but often useful: You can cross check them against eachother to see if they make different predictions, you can use whichever is cheapest when the decision doesn’t matter very much or most accurate when it does.

Additionally, it’s not really as cut and dried as I’m making it seem. What tends to happen is that explicit mental models turn into implicit ones. Once you’re familiar enough with an explicit mental model the ideas become intuitive and internalized and you need to consult it less and less.

Here are some tips for building mental models:

  • Reuse old mental models as much as possible. When learning python I started out as “Like Ruby with funny syntax”. Then I learned a bit more and replaced this with “Like Javascript with funny syntax and a decent module system”. Then I found out about descriptors and patched it as “Like Javascript with funny syntax and a decent module system, but bear in mind that the value you put into an object might not be the value you get out of it because of these magic methods”.
  • In general, build mental models as cheaply as possible. A mental model that you can build quickly is probably much more useful than a laboriously constructed one, because you’ll be likely to resist changing the latter.
  • Patch your mental models when they make wrong predictions
  • Test your mental models constantly. This is useful a) Because it leads to finding out when you need to patch them and b) Because it greatly hastens the process of turning them into implicit mental models, which makes you more able to readily apply them in future.

That’s about all I’ve got on how to build mental models. Now onto question 2: I can predict the consequences of my actions. How do I go about predicting the actions that will lead to the consequences I want?

Here is roughly what I think of as my algorithm:

Section 1:

  1. Generate an idea
  2. Is it obviously stupid? Throw it away and go back to 1.
  3. Is it still not obviously stupid after a little bit more thought? Set it aside
  4. How many not-obviously-stupid ideas do have I set aside? 3 or so? If so, proceed to the next section.
  5. How long have I taken over this? Too long? If so and I have any ideas set aside, go to the next section. Else, step away from the problem. Either come at it from another angle of attack or go do something else and let it simmer away in the background.

Section 2:

I now have a bunch of idea candidates. Put some proper thought into it and attempt to determine which amongst them is best. This may require actually trying some things out and gathering new information.

Once I have determined which of these is the best, decide if I’m satisfied with it. If I’m not, start the whole process again. If I am, this is the solution I’m going to go with for now.

So basically the idea is that you want to use cheap mental models to filter ideas quickly, then once you’ve got a few goodish ideas to compete against eachother you can properly explore how they work as solutions. I don’t know how accurate a description this is, but I think it’s broadly OK.

Unfortunately it’s got a big gap right at the beginning where I say “Generate an idea”. How do you do that? Just try things at random?

Well, you just… do. I don’t really know. This may be where I have to fall back on my “Maybe I’m just kinda smart?” answer, but if so then sadly I’m not actually smart enough to give a good answer here. Here are some things I think that I might be doing, but it’s mostly speculation:

  1. Try and narrow the search space as much as possible. If you think you might be able to solve the problem by making changes to a specific thing, only look at ideas which change that thing. If that’s proving not to work, try a different thing. You should be able to use a mix of past experience and proximity to guide you here – think of similar problems you’ve solved in the past and look near what the solutions to those were. If you can’t think of any similar problems or those solutions don’t pan out, look nearby to the problem. The advantage of looking at a smaller area is that there are fewer things to try so you’re more likely to hit on the right one quickly.
  2. Try and narrow the problem by breaking it up into smaller pieces. When you do this it becomes much easier to narrow the search space as in the previous section. In order to do this try to find natural “cleave points” where the problem breaks neatly along specific lines.
  3. When you decide a solution is a bad idea, see if there are any general reasons why it’s a bad idea and try to avoid areas that relate to those reasons.
  4. Conversely, if an idea almost works but not quite, try exploring around it to see if there are any variations on it that work better.
  5. If you’re totally stuck, try thinking of something completely out there. It probably won’t work, but exploring why it won’t work might tell you interesting things about the problem and give you other areas that worked.

I don’t think that’s sufficient. I’m afraid this might just be a case of practice makes less imperfect. I think part of why I’m “smart” is that my brain just won’t shut up (seriously. It’s annoying), so tends to gnaw at problems like a dog with a bone until they give in, which has given me a lot of practice at trying to figure things out. Really, this might be the best advice I can give you, but you’ve probably heard it so many times that it’s redundant: Practicing solving problems and figuring things out makes you better at it. Still, I think there should be things you can do above and beyond that – practice is no good if you’re practicing doing something badly. I’d love to have a firmer idea of what they were.

Fitting it all together

I like to think of this as a process of exploration. You start somewhere simple (I find “actually using the product” to be a good place to start). You look around you and, step by step, you explore around you while doing whatever jobs you can find in the areas you currently have access to. Your colleagues will help you find your way, but ultimately it’s up to you to draw your own map of the territory and figure out how all the different bits connect up. Think of this post as my personal and eclectic guide to software cartography.

Does it work? Beats me. Certainly I seem to be doing something right, and I really hope that this encapsulates some of it. I think it’s mostly good advice, but there’s definitely a bit of a danger that I’m cargo culting my own brain here.

If you try any of this, do let me know how it goes, and please do share your own ideas in comments, email, etc. because I’d really like to know how to get better at this too.

This entry was posted in life, Open sourcing my brain, rambling nonsense on by .

More on labels and identity

I’m heading to Nine Worlds later today, which means that instead of getting ready I’m procrastinating by thinking about anything other than the fact that I’m about to spend nearly three solid days surrounded by a very large number of near strangers and having to function socially in their presence.

This caused me to think about the you are not your labels post again and reminded me that I had promised a follow up to clarify my position on some things. I still don’t have a total follow up, but some of my thoughts on the subject crystallized while I was thinking about them in the shower (the shower is a wonderful place for composing thoughts), and I thought I’d write them down while they were in my head.

Identities are important

Apparently one of the vibes I gave off in that post was the standard “privileged person complains about identity politics because it’s so divisive“.

Allow me to state categorically: Fuck that. Identity is super important.

Often when something is described as “divisive” what is meant is “I hold this opinion. You hold that opinion. Therefore you are being divisive by holding a different opinion to me”.

Implicit in “Identity politics are so divisive” is “But aren’t we all the same really?”. It’s very easy to think we’re all the same if the dominant narrative of society is that everyone is like you (note: This is true even if you’re not actually in the majority. Witness the “male as default” thing despite the fact that men are a slight minority). Identity politics is only divisive if you hold the opinion that everyone should act like the default.

So, yeah. My point was in no way intended to diminish peoples’ identities. I apologize if it sounded that way. Identities are important and we should talk about them more, not less.

Labels are important

Labels are super useful.

As well as just the basic fact that language is basically our species’ hat – it’s most of how we actually get things done – labels serve a lot of useful functions.

When you’ve named something you’ve acknowledged that it’s a thing that happens reasonably commonly. When there’s a word for something you get to go “Hey! I’m not alone! There are other people like me!”. This can be really helpful – a lot of people think there is something wrong with them because they’re different from everyone else right up until the point where they discover that there are all sorts of other people like them (I don’t necessarily think it’s a good thing that we need other people like us to feel comfortable with our identity, but it’s a thing that happens whether I like it or not and I’m certainly not going to judge people for needing it).

It’s also useful in group formation. Having groups is useful – it gives you more force when fighting for equality because you can share a voice, it surrounds you with people who understand your problems, etc. It’s much easier to form a group around a concept when you have a label for that concept.

I personally don’t feel strongly about any of my labels, but that’s a personal choice which I wouldn’t especially encourage others to follow. It’s just how I work.

So, labels are great. I encourage you to use them freely and happily, should you desire to do so.

Labels are not identities

Hopefully I’ve now convinced you that the reason I think my point that you are not your labels is important is not because I think either labels or identities are unimportant.

In fact, the reason I think this matters is precisely because they both are so important.

The key thing is that they’re important in different ways. They’re highly connected, and both feed into each other, but they are distinct things which are important for distinct reasons. Sometimes the difference is subtle, sometimes it’s really not.

But what happens when you conflate them is that that difference is erased, and the way you treat each is distorted to match the way you treat the other. If you consider a label a part of your identity you may get very angry and judgmental about other peoples’ usage of it. If you consider your identity a part of your labels, you may get a form of impostor syndrome where you have a platonic ideal of what that label looks like and feel terrible about yourself for not matching that platonic ideal.

This is the key point I was trying to get at which I don’t seem to have adequately conveyed last time. It’s not that labels don’t matter or that identities don’t matter, it’s that the difference between the two does matter.

I may have more to say on the subject at some future date, but that’s all I’ve got for now. Hope it helped clarify my position.

This entry was posted in Feminism, life, Open sourcing my brain, rambling nonsense on by .