The last section of The Fifth Book of Peace talks about Thich Nhan Hanh a lot, so I decided to read one of his books next. One of his big themes is “mindful behavior”; as I understand it, this means that, when you do something, you should simply be doing that, not thinking about or working on many things at once. When you’re walking, you should simply be walking; when you’re sitting, you should simply be sitting. I’m quite bad at that: right now, for example, I am not mindfully writing a blog post, but am also looking up periodically at what’s on the TV. (The anglerfish battle on Iron Chef, which is really quite something: maybe I should be mindfully watching it instead of writing.)

Anyways, it seems to me that some of the XP processes could be thought of as enabling mindful programming. Take TDD, for example: rather than trying to simultaneously figure out what your code should do and writing code that implements that as well as possible, you’re instead either writing the next test, getting a test to pass however you can, or tidying up your code. So you’re always focused on one quite narrow task, trying to do it as well as possible. Pair programming helps with this, too: it enables the driver to narrowly focus on implementing what is closest at hand. It’s not clear to me that the navigator is working mindfully, however: the navigator has the jobs of writing down potential future tasks as they come to mind (so the driver doesn’t have to worry about them), doing low-level checking on the driver’s work (e.g. syntax checking), and paying attention to their direction at a high level.

I suspect that the customer/implementor split could be seen that way, too: you’re either picking what’s most important or implementing the chosen stories. (Or estimating stories; I’m not quite sure how to do that mindfully.) And I suspect a mindful attitude would make it easier to accept the pause in your work caused by the integration process, too.

I guess I’m pushing the analogy a bit far by that last paragraph, and I doubt it’s profitable to explain all XP practices in terms of mindfulness. But I’m pretty sure that there’s something to this at the TDD level: it’s much closer to what I would understand mindful programming to mean than almost anything else I can think of.

Post Revisions:

There are no revisions for this post.