Tuesday, 21 May 2013

Is Software Craftsmanship a Type of Martial Arts?

Featured below is an extract from a website called http://itsadeliverything.com! This extract provides an interesting link between software programming and traditional martial arts like Shotokan karate etc! Read it and see what you think!

Code Kata, Coding Dojos, and White Belt Programmers. What is it all about?
In part seven of my series on software craftsmanship I have a look at how software craftsmanship is sometimes wrapped in the language of martial arts.
I confess from the outset that the use of martial arts language really put my off software craftsmanship. But behind the kung-fu I found fairly uncontroversial practices.
I’ll have a quick look at the three software craftsmanship practices I found with a strong martial arts flavour: Code Kata, Coding Dojos, and White Belt Programmers. Then go into a more general discussion of what it is about.

Code Kata

A code kata is a small programming exercise to do by yourself. Here’s the first one, from Code Kata – How it started:
See if you can carve out 45 to 60 minutes to play with a small piece of code. You don’t necessarily have to look at performance: perhaps you could play with the structure, or the memory use, or the interface. In the end it doesn’t matter. Experiment, measure, improve.
In karate and other martial arts the practitioners do Kata, i.e. detailed choreographed patterns of movements practised, either solo or in pairs, to preserve and transmit proven techniques.

Coding Dojos

Okay, now that we’ve got some guys doing code kata we need a place for them to do it. And that is the Coding Dojo.
If you didn’t know already a Dojo is the name of the place were people study Japanese martial arts.
In a sense coding dojos are group code kata. One programming problem. One computer. Lots of people.

White Belt Programmers

“White Belt Programmer” sounds like a grade or rank but it is actually a mindset. The suggestion is to “set your previous knowledge aside as you approach new situations” (Red Squirrel: Wear the White Belt).

So where did the martial arts angle come from?

McBreen (2001) said "Craftsmanship is about gaining mastery" (p. 34). But McBreen had medieval guilds in mind so you have to look elsewhere for the original onnection between martial arts and software craftsmanship.
It turns out it was "Pragmatic" Dave Thomas who started it all. Dave coined the term "code kata" (Code Kata). Dave called it a kata because, when he had the original idea, he was waiting for his son to finish karate practice and occupied himself with a small programming problem.
Others subsequently picked up the martial arts theme. Laurent Bossavit started the idea for a coding dojos based on Dave’s earlier code kata (Apprenticeship Patterns: Perpetual Learning).

It takes practice, a lot of practice, to become Great

Code kata and coding dojos are about practice.
Peter Norvig: Teach Yourself Programming in 10 Years points to research suggesting it takes 10,000 hours or "about ten years to develop expertise in any of a wide variety of areas, including chess playing, music composition, telegraph operation, painting, piano playing, swimming, tennis, and research in neuropsychology and topology." He adds programming to that list.
That 10,000 hours isn’t just doing the job, it includes practice. In fact doing the job can be quite different from practicing to do the job (Steve Yegge: Practicing Programming). However, to be beneficial the practice needs to challenging, i.e. with tasks above your current ability (Peter Norvig).
Both code kata and coding dojos involve developers solving challenging programming problems that they might not encounter in their normal work. And that sort of practice is good.

Physical Repetition and Software Development

The use of language adopted from martial arts, such as Kata, suggests that softare developers will benefit from the same reptitive practices as martial arts do. In fact people advocating practice in software development – such as Peter Norvig – tend to make a parallel with disciplines that rely on physical practice; Norvig’s main example is from music.
The physical practice aspect of code kata attracts some criticism. David Harvey: On Practice, a musician and software developer, believes the parallel between practicing software via kata and music practice is misguided:
The core element of practice in music, and it seems to me in martial arts katas, is to focus concentration on recalcitrant physicality. Bodies are physical, continuous, software is just so damned discrete.
Although the support for practice in programming might be flawed because it derives from disciplines with strong inherent physicality few people seem to have tried code kata with that in mind. Mostly code kata are intellectual challenges.
It is, however, possible to practice the physicality of programming. "Uncle" Bob Martin described how he did this in his post What all this nonsense about Katas?. Bob repeated the same exercise again and again until he could get no better/faster at it. That included perfecting the number and order of key strokes to achieve the programming task. What was the upshot of this “practices”? After some self-reflection, and many, many, many hours of practice, Martin decided the answer to What all this nonsense about Katas? was that doing kata was "fun".

What I make of it

If I had to do a one word summary I’d pick “harmless”.
I initially found the martial arts imagery in use amongst the software craftsmanship community rather off putting. Don’t get me wrong; I love martial arts movies and like nothing more than watching a Wuxia movie. I just found the use of the language in a software setting rather pretentious.
When I looked at the practices I found them, well, pretty innocuous. Innoucuous practices with cool names.
Code kata cop some flak because of the implied physical practice, but for most people it is about solving intellectual problems. But either way, doing something fun sounds good to me.
In a subsequent post I’ll look at other definitions of software craftsmanship.

References

Bob Martin: What all this nonsense about Katas?
Coding Horror: The Ultimate Code Kata
Code Kata: How to become a Better Developer
Dan North: Programming is not a Craft
David Harvey: On Practice
McBreen, P. (2001). Software Craftsmanship: The New Imperative. Addison-Wesley.
Peter Norvig: Teach Yourself Programming in 10 Years
Steve Yegge: Practicing Programming

Joe Tubbritt
Blog 3

No comments:

Post a Comment