Side-effects

2025-04-05 • no tags • 697 words
Dealing with the side-effects of a task.

With actions and tasks, it is possible to do them in a side-effecty way, and, a pure way. For instance, imagine you have to water a plant. You will require a watering can, which may be in some location. You go grab the watering can, fill it up with water, and do the watering. Then, you have one of a few choices.

You could:

There is a tradeoff here. Returning it to its original location requires time, as you have to add another step of returning it to its original location. Option B has a cost, too: you will need to deal with the fact that there is now not a consistent place for the watering can to be, when you need to use it next.

With Option B, there are basically two ways to solve the "inconsistent place" problem created. The first, is to just, remember. Remember: I put the watering can by the dahlia last. The second, is to scramble about going: oh, where did I put the watering can...?.

The second clearly is a tradeoff that uses a lot of time, and as such cancels the benefit from not just moving it back in the first place.

The first, though, has a cost. More state needs to be maintained. Things become messy, intermingled. You might need a particular item for one task, and then for another, and so you have to remember where basically everything you use is.

As a result, the decision, whenever you are doing something, is: Do I want to do this action in a pure fashion? I'm using pure here in the sense of a pure function, though of course no action is truly pure in this sense. Rather, what I mean is, doing only the thing that you want, without having any other state changes incurred. Essentially, removing externalities.

Do I want the cognitive overhead of remembering where everything is?

Keeping things pure, or side-effect-free, has a benefit. If you want the watering can, you know where it will be: say, in the greenhouse. The same applies to everything: the toothbrush is always in the bathroom. Your wallet will always be either with you, or on your desk. Your cash and card will always be in the wallet. So on and so on.

It allows for a certainty with life. You are not going about and trying to constantly find things, remember where everything is. Instead, it promotes a form of stateless taskdoing. This is similar to what a todo list, or gtd accomplishes: you don't need to remember the state, just see the task and do it.

As for myself

I tend towards maintaining state. I put off the extra work of maintaining the purity of the state, with an idea that I am just lazy-evaluating the job to do. I view laziness as a virtue, not a vice. That said, I also know that I do it in a vicious way, whilst calling it a virtue. I just don't want to do the extra work.

I think, this goes hand in hand with the fact that I also jump between tasks. I don't say I'm going to weed this bed, and then just do that. I flit between beds, and weeding and sowing and... don't just focus on one thing at once. As a result, I tend to end up with many things on the go all at once, all in a bit of a half-baked state.

What I think I want, is to move toward (sort of) using gtd, deciding on a particular thing in my tasks list to do, and then just do that. At the end of each task, I can tidy up after myself.

This makes each task almost atomic, as well: an indivisible unit of productivity, with no other effects.

Caveat

A caveat will of course be the bunching of jobs. For instance, if I am at the allotment, then it wouldn't do to put my trowel back in the shed after every single thing I do. Instead, of course, I want to treat the allotment, or the 'session' as the task, and each 'task' almost as a 'subtask' where then I tidy up after myself after everything is done.