Saturday, September 22, 2012

Programming parenthetically

Part of a course I'm teaching on the Why and How of Computing (not the High and Wow of Computing as I sometimes imagine) is a gentle introduction to programming.  The idea is that to fully grasp the culture of we geeks, you must grasp our obsession with problem-solving.  We usually write our solutions down as algorithms, often in formal programming languages.

This semester I've been using a particularly user-friendly environment called DrRacket that lets the user choose from a tower of languages from beginner to expert.  The idea is to have level-specific capabilities and error messages.  I was skeptical until I noticed that common mistakes seem to get meaningful error messages.  For example, if I try to define a function with parameters (place-holders) that are literal numerical values, the error is

define: expected a variable, but found a number

... considerably more informative than the generic invalid syntax I find in another language used by beginners.

This, and other features of the DrRacket environment made me hopeful that my students would find it approachable.  I was still worried about my discipline's tendency to work from manuals and texts (even when these are online), whereas techniques as diverse as biochemistry and banjo picking are taught via video tutorials.  I decided to make a few introductory videos (very labour intensive, it turns out) available to get my students started.

Something must have worked.  My first quiz was meant to enforce the related tutorial exercise: work the exercise and you'll ace the quiz.  I left a generous amount of time for the first quiz, and asked them to evaluate a variety of expressions involving images, arithmetic, strings, and true/false.  I hoped most would get perfect, but assumed that there would be a combination of late-comers and some assuming that the work of the course hadn't started yet, and that they would contribute a significant portion of 0/2 or 1/2 scores.  What happened was that the quizzes were returned in record time (2 minutes, roughly) and are overwhelmingly correct.

It's always strangely surprising when something works out.

No comments: