Tags

, , ,

Leo and I have started into some fairly concentrated programming practice. We’ve done some light programming before, but it’s time to get into it for real.

Because you only have a kid’s attention for a few minutes at a time, you need to take maximum advantage of that obvious truism of learning: practice makes perfect (“How do you get to Carnegie Hall? Practice practice practice”, “The power law of practice”, etc.)

When Leo plays piano, he does a few a warmup exercises. (A better way to say this might be: “…I make him do a few warmup exercise.”) His go-to pieces for warm up are Saint-Saen’s Danse Macabre and Bach’s “Little Fugue” in G-minor.

He also does (…I also make him…) do a couple of programming warmups, specifically, factorial written iteratively, and recursively.

(The actual program we’re working on is a learning version of the animals game, which is nicely recursive. I’ve blogged about this before, but this time Leo is writing all the code.)

It dawned on me this morning — during a discussion of how stack overflow differs from numerical overflow — that there is a beautiful, if accidental, alignment between his piano practice and his programming practice. To wit, the central motif of the Danse Macabre is the rapidly played dance theme, which is very repetitive. On the other hand, The Little Fugue is more complex and, as described in great detail by Douglas Hofstadter, in Godel Escher Bach, is fundamentally recursive (or more generally, self-referential, where recursion is a particular version of self-reference.)


* I hate python; Unfortunately, it’s more useful than Lisp, these days, and we do a little Lisp too, when the moment affords.