« Code Kata Fifteen -- A Diversion | Main

January 30, 2007

Kata, Kumite, Koan, and Dreyfus

A week or so ago I posted a piece called CodeKata, suggesting that as developers we need to spend more time just practicing: writing throwaway code just to get the experience of writing it. I followed this up with a first exercise, an experiment in supermarket pricing.

Those articles generated some interest, both on other blogs and in e-mail. In particular, I’ve had a couple of wonderful exchanges with Bob Harwood. In turn, these have lead to a bit of research, and an interesting confluence of ideas.

Kata (Japanese for form or pattern) are an exercise where the novice repeatedly tries to emulate a master. In karate, these kata are a sequence of basic moves (kicks, blocks, punches, and so on), strung together in a way that makes sense. You’ll never be attacked in such a way that you could repeat a kata to defend yourself: that isn’t the idea. Instead the idea is to practice the feel and to internalize the moves. (Interestingly, kata are not just used in the martial arts. Calligraphers also learn using kata, copying their masters’ brush strokes.)

Kata and other artificial exercises form a large part of the work done by a karate novice. They practice for hour after hour. (Interestingly, I was talking about this with my son’s karate sensei, and he explained that as well as the standard combinations of moves in kata, he often has his classes do combinations that don’t feel natural, or where the body isn’t correctly positioned at the end of one to enter the next. He believes that teaching what doesn’t work is an effective way to help them improvise what does work later).

Once you get some way into your training, you start kumite, or sparring. Kumite is a supervised exercise between two students, or between a student and a master. Here they learn to assemble the basic moves into coherent sequences, combining offensive and defensive elements into something that works. While kata could be considered static, repeating the same sequence over and over, kumite is dynamic. Sparring continues throughout the rest of your training. It is interesting to watch the development of sparring as folks progress through the belt ranks. Beginners often seem to fall into the trap of being very rigid in their choice of moves. If a kick worked for them last time, then they’ll continue to use that kick over and over again. Similarly, some beginners attack and forget to defend, or spend all their time defending. After they become more experienced, their repertoire increases, and they learn to use appropriate moves which are strung together almost like a jazz improvisation: responding to their opponent but at the same time expressing their own plan of attack. Watching good black belts spar is fascinating; they manage to combine attacks and defenses in the same move, executing with both power and a great deal of subtleness.

Then, to quote Bob Harwood "Once a kata has been learned, then the kata needs to be forgotten. That is, at some point in studying Karate, typically the black belt level, the time comes to transcend the motions and seek meaning in the kata. The student discovers how his/her view of the world is reflected in their performance of kata, and (if lucky) they learn how to adapt the kata to new interpretations. As a student learns to do this, kata becomes more and more a part of their kumite (sparring). …the skill of self-discovery becomes part of their daily life. The study of koan is often used to promote this learning." Koans are questions without absolute answers which are used to break down assumptions and reveal underlying truths. The goal of a koan is not the answer, but thinking about the question. In the supermarket pricing example, when talking about "buy two, get the third free," the question "does the third item have a price?" is something of a (minor league) koan.

All of which brings us back to the Dreyfus model of skills acquisition (and you thought the title of this blog entry was the name of a law firm). The Dreyfus model suggests that there are five stages in the acquisition of mastery. We start at novice: unsure and with no experience. We don’t particularly want to know the "why," we just want to be shown what to do. We need to know the rules, because we just want to achieve some goal. As we get more experience, and progress through the next three levels, we start to move beyond this immediate, mechanical level. We gain more understanding and start to be able to formulate our own action plans. Finally, when we achieve mastery, we have all that experience internalized, and we can work from intuition. We no longer need the rules to support us; instead we write the new rules. Andy has a great talk about this (Herding Racehorses and Racing Sheep, available from the JAOO website.)

There’s a lot of obvious similarity between Dreyfus and the way people become masters of karate. The kata is rote learning, copying the master. Kumite is where you get to start applying the skills on your own. And then mastery, where you teach others, and where you use koan to attempt to discover underlying principles for yourself.

So, I’m planning to change my taxonomy of challenges somewhat. I think that as developers we need all three of these levels: kata for the things we’re only just starting to learn, kumite for the things we think we know, and koan for when we want to dig deeper. To quote from Andy’s talk, "Experience comes from practice".

Posted at 10:46 PM | Permalink

TrackBack

TrackBack URL for this entry:
www.typepad.com/services/trackback/6a00d83451c41c69e200d834df0fce53ef

Listed below are links to weblogs that reference Kata, Kumite, Koan, and Dreyfus:

Comments

spacer

really tho.... endless studies on how music students naturally do better in math..... many studies. Ive seen 40% in some groups. With just 15 minutes a WEEK in music. scary to think what would happen if we had our students play an instrument (of there choice) EVERY MORN........ those who wanted to draw or paint............ well hell yes...lol

I am proud to paint and make recorded music ... often within the same hour. After these moments I have known such detachment from even the idea of math so it intrigues me, these studies.

Posted by: JazzB | December 30, 2009 at 09:49 PM

spacer

I find Conzar's comments very sad—what a bleak view of the world.

I do code kata primarily for the same reason my black-belt son does his kata—for the pleasure of doing them. And, each time we repeat an exercise, we learn something.

The existence of guns doesn't make martial arts obsolete, any more than the existence of sequencers obsoletes the concept of a group of friends getting together to make music.

In martial arts, music, and programming, the doing gives as much pleasure as the outcome.

CodeKata is simply an excuse to do coding.

Posted by: Dave Thomas | December 27, 2008 at 10:39 PM

spacer

I agree with Woof. Katas also known as "forms" in the kung fu world are done in repetition. Also, a good kung fu master will explain the moves within the form while teaching you the form.

Its only in America and other places where master's don't properly teach their students the form because they want to protect their knowledge and ensure a paycheck.

I also think that exercising a language is a waste of time. Eventually, the language that one becomes proficient in will become obsolete. We already have tools that generate code.

Its only a matter of time before formal programming will be completely replaced.

Its the whole notion that repetition is something that humans don't like to do and that machines are good at doing.

As the gun has made martial arts obsolete, auto-generated code will make programming obsolete.

Posted by: Conzar | December 27, 2008 at 09:50 PM

spacer

Excellent idea to introduce the notion of kata to software development to instill a habit of constant practicing!

As for bringing together Dreyfus and the eastern way of learning you might want to have a look at the "shu - ha - ri" stages of skill development: www.aikidofaq.com/essays/tin/shuhari.html

-Ralf

Posted by: Ralf Westphal | June 24, 2008 at 03:00 AM

spacer

Yeah. It's all practice. Breaking up human experience into component signals is the same way.

Posted by: Jerng | June 09, 2008 at 11:27 PM

spacer

Most of what you said is reflected in Shuhari: en.wikipedia.org/wiki/Shu_Ha_Ri

Posted by: Grey | January 04, 2008 at 08:15 AM

spacer

Kata. Meh.

I'm familiar with both the concept and meaning of kata ('form', or 'elements'), and I've heard the word used in the context of code practice here and there for awhile. But it's just the wrong word to use.

First off, kata is form repeated, and a terminal mode of practice in itself. Kata are a way to mastery, but a main point is 'becoming' the kata as it is being practiced, in a way. It doesn't usually help to get too metaphysical here, because the benefit, no matter what spiritual or mental take you have on it, is simply making the movements a part of your natural responses.

Fine. But kata don't change up, really. I mean, you'll see improvised portions of kata in competition, as well as free forms and other modes of kata, but in traditional practice, you don't go messing with kata too much because the point is conditioned response. It's especially relevant to full-body practice of movements, since movement training is, generally, especially challenging even for those who are gifted.

Music practice is a better analogy. You *do* go ahead and change up scales, for example, to a degree. You play arpeggios, permutations of patterns, different positions, etc., you get them under your fingers. But that's not kata, which would be playing the same exercises over and over until they're more than second nature, like Hanon for the piano.

Practice is really all you're talking about here, but you're dressing it up for some reason with a word which isn't really accurate. Opinions will vary, I'm sure, as to the appropriateness of the word, and no one will really mind, probably, one way or the other. But developers do seem to get a little bent when other developers use the words 'closure' or 'continuation' inappropriately.

I would never want to do a code 'kata'. I will never be interested in coding, for example, quicksort over and over and over again until quicksort and I are one. There may even be a huge benefit in doing this, but I'll die of boredom long before I reach a quicksort epiphany.

I do, however, practice quite a bit, with Project Euler, or the ACM judge at UVa, or TopCoder. Is this nitpicking? I'm sure most people will think so, yes, but everyone has their nits to pick about certain terminology, and there's something to be said for choosing the correct words. I will 'woodshed', or 'practice', or 'spar' or 'hack' or 'hammer' -- all fun and, more or less, accurate words within the context they're usually used. But 'kata'? No, not for me, unless I'm wearing a uniform and Sensei is shouting "ICHI!", "NI!", "SAN!", "SHI!".

Posted by: Woof | August 18, 2007 at 02:59 PM

spacer

**To quote from Andy’s talk, "Experience comes from practice".**

I picked up a saying in the last couple of years that I really like: "Good judgement comes from experience. Experience comes frm bad judgement."

You just hope that you're not gaining that "experience" on the job, but from what you say, it seems that's the way things work.

I'm just getting started down the programming road at a ripe age, but I'm very motivated and your explanations are aligned with my other interests as well.

Thanks!

Posted by: Sam | March 23, 2007 at 04:39 PM

spacer

Great stuff Dave. I've been thinking about the similarities between studying music and programming, and It seems our field lacks enough Katas.

In learning music we practice things like scales , arpeggios, and study pieces called Etudes. Forunately in the music field there are hundreds of years of great exercises that we turn to when we are studying.

So I'm looking forward to more Kata's, Kumite and Koans.

Posted by: MikeBlake | February 21, 2007 at 02:44 PM

spacer

The link to Andy's presentation is broken (in the word avaiable).

Posted by: Paulo Neves | February 02, 2007 at 12:54 PM

spacer

I think you're dead on. For those wishing a head start, there are tons of resources online for ideas. Programming competitions generally post all of their problems for past competitions (usually requires advanced algorithm and math theory, though). Sites like RubyQuiz.com offers regular challenges (which can really be done in any language and vary in complexity), and often post reviews of everyone's solutions afterward. Any site that lists standard programmer interview questions is a gem of kata-like material that I personally practice all the time (but especially when picking up new languages).

If you want to master your craft, you must attain a broad base of experience and always seek deeper understanding. If the only coding you do is during your day job on assigned tasks only, then mastery is out of your reach.

Posted by: Michael | January 31, 2007 at 09:55 AM

spacer

Nice essay.
Is it JAOO or JOAA ?

Posted by: HS | January 31, 2007 at 07:00 AM

The comments to this entry are closed.

Subscribe to this blog's feed
spacer

Other links

  • My Blog
    Dave's blog, which stuff on Ruby, Rails, general programming, careers, and other stuff.
  • The Pragmatic Programmers
    Where it all started! Have a look at the books we're publishing on all sorts of programming topics. If you liked the kata, you might also like The Best of Ruby Quiz.

Archives

  • January 2007

The Kata

  • 1. Supermarket Pricing
  • 2. Karate Chop
  • 3. How Big, How Fast?
  • 4. Data Munging
  • 5. Bloom Filters
  • 6. Anagrams
  • 7. How'd I Do?
  • 8. Conflicting Objectives
  • 9. Back to the CheckOut
  • 10. Hashes vs. Classes
  • 11. Sorting it Out
  • 12. Best Sellers
  • 13, Counting Code Lines
  • 14. Tom Swift Under Milk Wood
  • 15. Playing With Bits
  • 16. Business Rules
  • 17. More Business Processing
  • 18. Transitive Dependencies
  • 19. Word Chains
  • 20. Klondike
  • 21. Simple Lists
Lijit Search
gipoco.com is neither affiliated with the authors of this page nor responsible for its contents. This is a safe-cache copy of the original web site.