[plt-scheme] Hit People Over the Head with HtDP and martial arts!??

From: Carl Eastlund (carl.eastlund at gmail.com)
Date: Thu Feb 5 18:04:54 EST 2009

On Thu, Feb 5, 2009 at 5:45 PM, Paulo J. Matos <pocmatos at gmail.com> wrote:
> I trained JuJutsu for 15 years before coming to the UK. My teacher had
> some interesting insights sometimes but I never really related it with
> programming. :)
> Now, thinking about it, I guess there are a lot of similarities
> between programming and learning a martial art. To begin with, you can
> learn martial arts without train as you can learn programming without
> writing code.
> In fact, my teacher used to say: "to improve you only need to do 3
> things: train, train, train."
> Maybe we can apply it to programming and say: "to improve you only
> need 3 things: code, code, code"? Maybe here I would add "read good
> books". This divergence from the martial arts world is that most of
> the times you train with your teacher, so training includes the
> process of learning new techniques and perfecting the old ones, while
> in programming sitting alone in a room coding won't probably teach you
> anything new.
> Interesting to see, as an experiment, how would work the teaching of
> programming as if it were a martial art? Every so often you mean for a
> couple of hours with your teacher and you code with him, and maybe you
> get also to see your master code with someone else and then you
> practice by coding with a partner... This would be an awesome
> experience! :D

I've practiced a number of martial arts sporadically over the years;
mostly kung fu recently.  I was first introduced to comparisons
between martial arts and computer science when I took Stephen Rudich's
discrete math course.

He starts the course off by asking for three student volunteers to
come up and try to punch him.  The first, he pushes away as he jumps
to the side.  He explains this as the novice solution: brute force and
inefficient, but simple and effective.  The second, he simply blocks.
He explains this as the expert solution: more efficient, using one
maneuver for one attack, but still expending about as much effort as
the opponent.  The third attack, he twists his shoulders just a bit to
get out of the way of.  He explains this as the master solution, using
the minimum amount of effort necessary to make the attack irrelevant,
without wasting effort trying to prevent it.

The rest of the class is spent tackling various problems in
combinatorics, cryptography, and other tricky algorithms, always
progressing through the analogy of the naive novice solution, the
efficient expert solution, and the painstakingly researched, usually
optimal master solution.

Unfortunately for me, Professor Rudich was on sabbatical when I took
the class, so I didn't get to see him demonstrate it.  Professor
Maggs, standing in for him, did explain what we would normally have
seen, and used the analogy throughout the course.

Since then, I often compare martial arts to computer science, and in
the broad strokes it's usually pretty close.  (I suppose it could just
be easy to maintain a superficial analogy.)  Martial arts is presented
as "train, train, train", but you can't make someone go train until
you've first showed them how to do something the right way.  Training
without instruction is a good way to get hurt.  Programming classes
may seem like "read, read, read", but if you don't apply your
knowledge to writing programs you won't really understand it.  In both
cases, you need to learn the fundamentals, then apply them until
you've mastered them.


Posted on the users mailing list.