software considered repulsive

19 May 2020

There's a meditative practice, Patikulamanasikara, which is something like: memorizing a particular list of 32 parts of the body, and then working your way through the list, directing your attention to each one in turn, and how repulsive that part of the body is. Not just being disgusted, but also accepting of the fact that we are composed of (repulsive) organs. I don't know much about Buddhism, and I don't find bodyparts particularly disgusting, but I think that's sufficient springboard.

A programmer can take various attitudes towards the various tools and components that they are working with. You can absolutely take an attitude of wonder and delight to particular pieces of code. For example, labeling a piece of code "black magic" might indicate that you are taking an attitude of wonder and delight towards it (possibly "black magic" indicates another attitude, but that's not the point). Another example: You can feel emotions of authority, either trying to be authoritative and giving instructions to programmers and/or machines; think of comments like // A Foo should consist of a Bar and a Baz. Alternately, trying to be compliant to authority, thinking things like // According to Best Practice, the names of methods should be imperative verbs. There are a lot of attitudes and emotions a programmer can take towards code, and they don't really have propositional content. They're nonfalsifiable, just mindsets.

What if you systematically worked through your often-used and/or near-to-hand tools and components, and deliberately paid attention to them, trying to take an attitude of both disgust and acceptance towards them? Might that practice lead to a kind of loose mental grip on these tools and components that might have advantages? It might allow you to evaluate them, choose to stop using them, replace them with other tools, or fix them, more readily than other mindsets. (Other mindsets surely have other advantages; just pointing out that this one might have some nice advantages.)

This connects to the idea of "code smells". Generally refactoring enthusiasts speak highly of acceptance of the existing code, and that acceptance is certainly part of the Buddhist practice. However, the odds are, almost any piece of code, if you give it to a refactoring enthusiast, will have some (bad) "smells". You might choose to attribute this to the world claiming that most code is bad, due to the sorry state of programming practice or something. On the other hand, you could instead attribute this "all code has (bad) smells" as a mindset recommended by the refactoring enthusiasts. That is, like the Buddhist practice, refactoring enthusiasts recommends taking an attitude of accepting disgust toward everything.

One possible translation of "Patikulamanasikara" might be "[…The body] considered repulsive". (To be clear, I am trying to reference Dijkstra's letter "Go To Statement Considered Harmful").

Who wants to try "[…Software] considered repulsive" meditation?