Programming, Zen, and…Origami

I’ve started re-reading Zen and the Art of Motorcycle Maintenance. There are so many gems in it that I’ll probably start a page in my backpack for them. Here’s one I like:

”…I’ve a set of instructions at home which open up great realms for the improvement of technical writing. They begin, `Assembly of Japanese bicycle require great peace of mind.’”

This produces more laughter, but Sylvia and Gennie and the sculptor give sharp looks of recognition.

“That’s a good instruction,” the sculptor says. Gennie nods too.

“That’s kind of why I saved it,” I say. “At first I laughed because of memories of bicycles I’d put together and, of course, the unintended slur on Japanese manufacture. But there’s a lot of wisdom in that statement.” … “Peace of mind isn’t at all superficial, really,” I expound. “It’s the whole thing. That which produces it is good maintenance; that which disturbs it is poor maintenance. What we call workability of the machine is just an objectification of this peace of mind. The ultimate test’s always your own serenity. If you don’t have this when you start and maintain it while you’re working you’re likely to build your personal problems right into the machine itself.”

I think this peace of mind is needed if you want to achieve that mental state called flow. I’ll bet that “workability of the machine” translates nicely into the design of the [programming language, platform, library] you’re using – I like Ruby because it gives me greater peace of mind! – but that’s another discussion. For now, I want to talk about two ways I have of getting back that peace of mind, when I lose it.

Origami!

I learned all the origami I know from a book I got in Disney World when I was 10, and I’ve been folding on and off since then. I’m good enough to impress people who either have never tried it, or are very polite. Man, did I get tired of doing those dollar-bill bow-ties for relatives to leave as fancy restaurant tips.

Folding origami is a really interesting way to spend time (no joking!). You line up edges and folds as perfectly as you can, because the first few times, when you weren’t so careful, it came out like crap, and you learned that origami is a precise art. So you check twice before creasing the paper, and get it as perfect as you can. But the paper gets in the way! If you fold paper over itself enough times, you find that its thickness only seems negligible. You can get really thin paper and try to ignore this, but eventually, it’s always a factor. If that’s not enough, try remaking a fold that didn’t come out right—remake it enough times, and that crease starts to remind you of the maps in the car. Balancing geometric precision against the paper’s physical limits, the abstract ideal against the actual reality, is a lesson that applies beyond origami. How about when applying software design principles? Hiding your object’s data is a good idea, but 50 private variables with 50 getters and 50 setters is decidedly not. If your code reads like an illustrated tour of the GoF Design Patterns, you should chew on this.

Origami philosophy aside, it’s relaxing to do, once your fingers are accustomed to it. After folding a few thousand pieces, finding the sweet spot between the geometry and the paper is almost meditative. How well I achieve that balance is my measure of a piece’s quality.

Origami requires a light focus—just enough to let your mental peripheral vision wander. It’s an easy jog for your brain, somewhere bewteen sitting on the couch and running up a mountain. The same way some people need constraints to be creative, my mind needs something tiny to do, for it to really relax. All this sounds very zen to me: beginner’s mind, nothingness, mindfulness…I have to think about this some more.

Juggling!

I started juggling two weeks ago. Ok, started trying to juggle two weeks ago, and started something-almost-like-juggling in the last few days. Maybe I’ll start juggling this week…I can feel myself getting close. At any rate, I’m at the point where it’s not so frustrating, so I’m even more apt to practice (be warned, my cats).

Juggling also requires a light focus. It’s also kind of medidative. Until I drop a ball, which always happens, but up to that point, it’s really pleasant.

In Closing, Back to Zen

There’s something that connects movement and brainpower, I’m sure. I don’t know nearly enough about it to say anything conclusive or probably even convincing, so I’ll just end with some words from ESR, and if that doesn’t convince you, well…

Train in a martial-arts form. The kind of mental discipline required for martial arts seems to be similar in important ways to what hackers do. …The most hackerly martial arts are those which emphasize mental discipline, relaxed awareness, and control, rather than raw strength, athleticism, or physical toughness.

[The emphasis is of course mine.]

About these ads