One theme that constantly comes up in Tai Chi classes is keeping control over where your center of gravity. At any point in the form, you should know whether your weight should be completely over your right foot, completely over your left foot, somewhat on the right side, somewhat on the left side, etc. You can see an example of that in this stepping technique drill video by my teacher: he shifts back and forth from leg to leg, and pauses with all of his weight on his stationary leg while taking a step with the other leg. (Later on in the video, he even raises his moving leg to emphasize the single-leg position.)

That’s an isolated exercise, but there are several places in the form where you’re doing a similar sort of steps. And, a few months, ago, when my teacher was giving me pointers after watching me go through the form, he noted on one of those sections (Twist Steps) that I wasn’t shifting my weight properly, and suggested that, before moving my foot forward, I should sink into my weighted leg, to help ensure that I was positioning my weight properly.

I worked on that over the next week or two, and it felt like my technique got significantly better, and not just on that one part of the form: I could feel my body clicking into place on transitions in a way it hadn’t before. I wasn’t sloppily combining weight shifts with other movements (or at least I was less sloppy!): at each point, I knew where I was and what I was doing.

 

When I’m programming, I do test-driven development. Which means that I know what I’m doing at each point. Sometimes I’m writing a failing test, sometimes I’m getting that test to pass, sometimes I’m refactoring to improve the quality of my code. (And sometimes I’m thinking about what to do next!)

This clarity of state reminds me of practicing my form: I have some specific behavior change that I’m working on at any point (similar to knowing the next move in the form); I know whether I’m adding a red test or making it green (similar to knowing whether I’m moving my feet and what my weight is doing); and I pause periodically to refcator (similar to the weight sinking mentioned above, and to the exhaling and relaxation that I do in pauses in the form).

 

Of course, the Tai Chi form is an artificial practice: the moves have applications, but they’re quite different from how you act in other contexts. For example, when walking down the street, I don’t lift my left leg, move it over to my right leg to make sure I’m balanced on my right leg, then stick my left leg back out and put it on the ground without placing significant weight on it, and finally shift to my left leg while maintaining contact on the ground with both legs. Instead, I just move my left leg straight forward in a way where I’m somewhat off-balance for most of the movement. (Though, arguably, I’m less off-balance while walking normally now than I was a year ago: if I’m thinking about it, walking really does feel different now than it once did!) So why don’t I do the same thing while programming: treat test-driven development as a valuable exercise but not my normal mode of behavior?

When doing Twist Steps, my teacher says to think about the move as if you’re walking on thin ice: don’t put your weight down until you’re sure the ice will hold and that you won’t slip and fall. The thing is, while programming, you’re walking on ice a lot of the time: there’s almost always something that can go wrong if you’re not careful. If your code base is decent quality, most of the time it’ll be okay for a while if you march boldly ahead, but every so often, surprises will pop up, and you’ll fall flat on your ass in the good case, sink into icy water in the bad case.

So spend your time feeling out your territory while programming: that’s the red-green part of the TDD cycle, small steps guided by tests are what help you avoid slipping too often. But in programming, unlike when walking in the physical world, you’re directly affecting the territory that you’re navigating: you can make it more or less slippery as you walk around. So refactor constantly: that improves the quality of your surface.

And, if you’re doing that, then yes, you can walk faster! Which can tempt you to stop doing TDD; but, the better the quality of the code, the easier it is to add that next test that makes your movement safe. And, as with the form, if you practice mindfully over and over again, you have the potential of moving more quickly while maintaining discipline: you can stop and think if you want, but you can also move quickly without losing clarity.

Post Revisions:

This post has not been revised since publication.