Monday, November 30, 2009

Unit Testing Your Brain

This post has been stewing around in my brain for awhile. I've wanted to write about memorization and it's role in being a productive programmer. For many a developer, the web acts as a useful crutch (and I'm as guilty as anyone).

As an example, I noticed that every time I wanted to do some type of regular expression operation in java, I almost always resorted to googling for a java regex tutorial to relearn how to do it. It's really quite an easy api to use, but it was one of those things that just wouldn't stick in my head for more than a few days at most.

There is a class of general programming tasks that I don't do frequently enough to have them automatically committed to memory, but at the same time I do use them frequently enough that I found myself wasting time relearning things over and over again. After relearning the same thing 3 or more times, I started asking myself if there wasn't some tool I could use to improve the situation.

I had a discussion about this with Curtis Dunham, who introduced me to a really neat, but hard to pronounce application called Mnemosyne.

Mnemosyne is a GUI app, written in Python and runs on all the popular platforms. It acts as a system of flash cards. You create a "deck" of cards with questions and answers, and invest a few minutes of your time each day answering them. As you answer each question, you rate your memorization on scale of 1-5. Mnemosyne then uses this information to create a dynamic schedule of questions for you based on what you're having the most trouble memorizing.

The way I use it is analogous to a common unit testing technique, where whenever you have a program fault, you create a unit test for that specific fault, and then implement a fix. I apply this same technique with Mnemosyne. If I am faced with a programming task that I can't remember how to perform, but I at least know that it was something I had already learned once before (a memory fault), into the deck it goes. The deck acts as a suite of unit tests for my brain this way.

Now if I want to do a pattern match in Java, I no longer spend time looking for examples in old source code or hitting up search engines. Mnemosyne is a free app, that with a small investment, can pay large dividends.

Saturday, November 21, 2009

Personal Update

I've been too busy lately to keep the blog updated, but life will be getting back to normal shortly. My family has just finished relocating from Dallas, TX to Dayton, OH.

I've been working fulltime at TuneWiki Inc since August, developing some very exciting products. I'm now working out of their central development hub with fellow Android hacker Zach Hobbs.

The team here is great, I expect to be both contributing and learning a lot. I've got a backlog of blog articles I need to hammer out.