Thursday, September 18, 2008

A Meanderingly Long Post about Computer Science Classes

On Tuesday the professor of my CS class was at a conference and had a colleague substitute for him. One of my favorite ways to get perspective on how someone teaches is to see someone else substitute for the day. Sure, sure, sure, the sub is always at a disadvantage. I understand that. But seeing someone else's idea of how to present the material gives me insight into the big picture plan.

Based on the two computer science classes that I took at Dartmouth, the one that I sat in here several years ago, and what the sub did on Tuesday, there appears to be a classic way to teach computer science. It seems to be based on filling the board with a jumble of boxes and pseudocode (and possibly some graphs).

The recurring characters are the box:

The rectangle:

The rectangle made out of boxes:

And the combination of any of these:

When teaching computer science in the classical mode, one draws several of these creatures, fills them with symbols such as ai or a quasi-nonsense collection of English words (like animal, cat, dog, fur, teeth) and draws lines and arrows connecting them. Sometimes there will be a graph (typically a tree). You can recognize that the graph is part of the "theory" side of computer science because its nodes are circles, not boxes or rectangles.

Sometimes this is punctuated with useless pseudocode:

while problem isn't solved
SOLVE_PROBLEM();

The class that I am taking this semester is totally different.

For one, the guy who is teaching the class is a bit of a rock star, and he knows it. Just about everyone has an opinion about him that they're willing to share. He has won a big-deal teaching award despite there being a lot of students that really kind of hate him. I find him very, very entertaining (since I'm taking the course for free as a non-degree student, I have a lot more leeway to find things entertaining). He also reminds me of the super-smart people (smarter than regular smart people) who I work with at my summer job.

The class that I'm taking has the word "algorithms" in its name. The catalog description gives me flashbacks to the theory-heavy intro courses that I took at Dartmouth where you were never far from proving something by induction or calculating something involving nlogn. But this is not Dartmouth College, beacon of the liberal arts, enlightening curious minds with the beauty of algorithm analysis. This is the inexpensive state university; my classmates plans involve little more than earning a good living writing code. Most of them don't really care about nlogn. They'd probably be content with a chart classifying algorithms as "sucks" and "doesn't suck."

And so this class fits well with what the students want. I think we made it nearly four weeks into the semester before meeting our first algorithm, heap sort. Heap sort has a special place in my heart because the last time I took a programming course (winter 1994), I was taking it pass-fail and all the homework totaled only 20% of the grade, so I didn't do any of the programming assignments -- except for heap sort. (Fittingly, it has been claimed that we will not have to implement heap sort for homework.)

Just about the entirety of every single class is him writing code. He hooks up his laptop to the projector, and starts writing code. He's like the Bob Ross of computer programming (well, a sarcastic Bob Ross of computer programming). He starts from scratch and writes a program to do some fairly straightforward task, demonstrating the process along the way. At the end of the class, there are no boxes or rectangles on the board. Just a program on his computer.

He spends most of class focused on very, very practical stuff. (And, fortunately for me, it's also part of his style to assume that just about everyone has forgotten almost everything from the prerequisite courses.) For most of the theory side of things, he refers us out to the wikipedia. Maybe makes a token attempt to mention it. But, for the most part, very, very, very little class time is spent on stuff that few people will understand. It makes sense: If you can't figure out what something takes logn time from reading the wikipedia at your leisure, you almost certainly won't be able to follow it in real time in class.

I've seen someone else try to teach from his notes (class I sat in years ago), and it didn't go well because the instructor didn't commit. He'd pick up the chalk and start drawing boxes.

As much as I admire his teaching style, there are some things that have me worried about my own progress in the course. The only notes are based on the programs that he posts after class. (It's impossible to take notes in real time as he edits the programs.) I'm worried about how much I'm going to remember over the whole semester. I'm not very good at the whole "learn by doing" thing because I don't really remember the fussy details no matter how many times I look them up and do them.

The course is about one-third over. We'll see how it continues.